How to project a point on to a sphere

后端 未结 3 1746
情话喂你
情话喂你 2021-01-17 13:31

If i have a point (x,y,z) how to project it on to a sphere(x0,y0,z0,radius) (on its surface). My input will be the coordinates of point and sphere. The output should be the

3条回答
  •  鱼传尺愫
    2021-01-17 13:59

    It works if you set the coordinates of the center of the sphere as origin of the system (x0, y0, z0). So you will have the coordinates of the point referred to that origin (Xp', Yp', Zp'), and converting the coordinates to polar, you discard the radius (distance between the center of the sphere and the point) and the angles will define the projection.

提交回复
热议问题