12 views (last 30 days)

Dear Forum,

I am given a ,,. Does Matlab have a function to convert and find the from a new ?

Sindar
on 29 Sep 2020

It sounds like the goal is to find the projection of the vector along the direction defined by theta=100, phi=150. If this is the case, one way is:

[x2,y2,z2] = sph2cart(150*pi/180,100*pi/180,1);

[x1,y1,z1] = sph2cart(phi1*pi/180,theta1*pi/180,r1);

v12_proj = x1.*x2 + y1.*y2 + z1.*z2;

Opportunities for recent engineering grads.

Apply TodayFind the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
## 6 Comments

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028266

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028266

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028308

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028308

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028335

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028335

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028395

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028395

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028407

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028407

## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028890

⋮## Direct link to this comment

https://in.mathworks.com/matlabcentral/answers/601363-rotate-spherical-coordinates-to-find-new-vector-magnitude#comment_1028890

Sign in to comment.