MATLAB: How to get the coordinate of a point on Sphere

mathematics

Best Answer

Use sphere2cart to get points 1 and 2 in Cartesian coordinates P1=[x1;y1;z1], P2=[x2;y2;z2]. You can find eta by doing
eta = acosd(dot(P1,P2)/r^2);
Then you can download AxelRot and rotate P1 toward P2 by (1+delta)*eta
P3 = AxelRot(P1,(1+delta)*eta,cross(P1,P2),[]);
Related Question