如何将点投影到球体上 [英] How to project a point on to a sphere
问题描述
如果我有一个点(x,y,z)如何将它投影到一个球体(x0,y0,z0,radius)上(在它的表面上)。
我的输入将是点和球体的坐标。
输出应该是投影点在球体上的坐标。
只需从直角坐标转换为球坐标?
- $ b $ b
-
将该点写在以球体中心为中心的坐标系中(x0,y0,z0):
$ b $ p = ',y',z')=(x - x0,y - y0,z - z0) 计算这个向量的长度: -
缩放矢量,使其长度等于球体:
Q =(radius / | P |)* P -
您的原始坐标系来获得投影:
R = Q +(x0,y0,z0)
| P | = sqrt(x'^ 2 + y'^ 2 + z'^ 2)
>
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 coordinates of the projected point on sphere.
Just convert from cartesian to spherical coordinates?
For the simplest projection (along the line connecting the point to the center of the sphere):
Write the point in a coordinate system centered at the center of the sphere (x0,y0,z0):
P = (x',y',z') = (x - x0, y - y0, z - z0)
Compute the length of this vector:
|P| = sqrt(x'^2 + y'^2 + z'^2)
Scale the vector so that it has length equal to the radius of the sphere:
Q = (radius/|P|)*P
And change back to your original coordinate system to get the projection:
R = Q + (x0,y0,z0)
这篇关于如何将点投影到球体上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!