如何将点投影到球体上 [英] How to project a point on to a sphere

查看:503
本文介绍了如何将点投影到球体上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个点(x,y,z)如何将它投影到一个球体(x0,y0,z0,radius)上(在它的表面上)。
我的输入将是点和球体的坐标。
输出应该是投影点在球体上的坐标。

只需从直角坐标转换为球坐标?



    $ b $ b
  1. 将该点写在以球体中心为中心的坐标系中(x0,y0,z0):
    $ b $ p = ',y',z')=(x - x0,y - y0,z - z0)

  2. 计算这个向量的长度:



    | P | = sqrt(x'^ 2 + y'^ 2 + z'^ 2)

  3. 缩放矢量,使其长度等于球体:

    Q =(radius / | P |)* P


  4. 您的原始坐标系来获得投影:

    R = Q +(x0,y0,z0)


>

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):

  1. 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)

  2. Compute the length of this vector:

    |P| = sqrt(x'^2 + y'^2 + z'^2)

  3. Scale the vector so that it has length equal to the radius of the sphere:

    Q = (radius/|P|)*P

  4. And change back to your original coordinate system to get the projection:

    R = Q + (x0,y0,z0)

这篇关于如何将点投影到球体上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆