3D coordinates on a sphere to Latitude and Longitude

后端 未结 7 752
慢半拍i
慢半拍i 2020-11-30 19:25

I\'ve got the following information:

There exists a sphere with origin (0,0,0) and radius R. After doing a ray-sphere intersection I know a point (XYZ) in 3D space t

7条回答
  •  盖世英雄少女心
    2020-11-30 20:04

    I guess it should not be difficult to find the spherical polar coordinates from x,y,z (3d-coordinate system).

    1. r is always constant if it's on surface.

      enter image description here

    2. (90 - θ) your latitude (negative means it's on the bottom) as it's measured from top.

      enter image description here

    3. φ is your longitude. (but not quite sure about longitude system)

      enter image description here

    Also check this diagram from wikipedia.

    enter image description here

提交回复
热议问题