boost ublas: rotate 2d vector
Erm. I hope I am seriously overlooking something. I want to rotate a 2d vector (kartesian) v by a certain angle phi.
I can't find a function开发者_StackOverflow社区 that generates the appropriate matrix or just performs that function.
I know how to do this by hand. I am looking for a ublas utility "something" that does this for me.
BLAS == Basic Linear Algebra Subroutines, emphasis on the basic. The BLAS functions are extremely general, they don't have anything nearly as specific as 2D vector rotations. Just do it manually: make your own function that builds a
[cos phi,-sin phi sin phi, cos phi]
matrix and multiplies it with your vector.
精彩评论