vb.net提供了许多命名空间,三角函数在 System.Math 命名里:
在代码窗口的最上面添加如下代码:
Imports System.Math
见下图:
直接用rotx函数,
【Syntax】
R = rotx(ang)
【Description】
R =
rotx(ang) creates a 3-by-3 matrix used to rotated a 3-by-1 vector or
3-by-N matrix of vectors around the x-axis by ang degrees. When acting
on a matrix, each column of the matrix represents a different vector.
For the rotation matrix R and vector v, the rotated vector is given
by R*v.