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]])
精彩评论