开发者

creating a numpy vector using 3 components

I want to create a vector in numpy using 3 components Vx,开发者_StackOverflow Vy, Vz as sown below. Can anyone help? Thank you

from numpy import cos, sin

Vx = cos(alpha)* cos(beta)
Vy = sin(alpha)*cos(beta)
Vz = sin(beta)


With NumPy, vectors (and matrices for that matter) are just Python arrays. As in

from numpy import array
myVector = array([Vx, Vy, Vz])
myMatrix = array([[Vx, Vy, Vz], [1,2,3]])
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜