开发者

boost ublas: rotate 2d vector

开发者 https://www.devze.com 2022-12-26 21:35 出处:网络
Erm. I hope I am seriously overlooking something. I want to rotate a 2d vector (kartesian) v by a certain angle phi.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消