Enlarge ublas: rotate vector 2d

Hmm. I hope I'm seriously missing something. I want to rotate a 2d (kartesian) v vector by a specific angle phi.

I can’t find a function that generates the appropriate matrix, or simply does this function.

I know how to do it manually. I am looking for the ublas utility "something" that does it for me.

+2


source to share


1 answer


BLAS == Basic linear algebra routines, emphasis on basic . BLAS functions are extremely general, not nearly as specific as 2D vector rotations. Just do it manually: create your own function that will build

[cos phi, -sin phi
 sin phi, cos phi]


and multiplies it by your vector.

+2


source







All Articles