Earth Latitude & Longitude to Latitude & Longitude on a 3D sphere

流过昼夜 提交于 2020-01-01 19:07:20

问题


I have never done this sort of thing before,but what I am doing is making a 3D sphere (which has earth like texture) like shape where I want to plot locations onto it using the latitude and longitude from google maps of specific locations.Now I am wondering , my sphere radius is obviously smaller than earths radius, would this still effect the position of the latitude and longitude values to xyz given the following formula:

tx = radiusOfSphere * cos(latitude) * cos(longitude);
ty = radiusOfSphere * -sin(latitude);
tz = radiusOfSphere * cos(latitude) * sin(longitude);

回答1:


Yes.

  • tx^2 + ty^2 + tz^2 = radius^2 & math = radius^2, so you are on your sphere.
  • if latitude=0, then ty = 0, so you are on a circle parallel to the equator.
  • if longitude=0, then tz = 0 so you are on the a meridian.

Just check that you are in xyz not xzy or zyx, and that North is x>0 and East y>0, or whatever signs are compatible with point of view of your 3D rendering soft.



来源:https://stackoverflow.com/questions/15211776/earth-latitude-longitude-to-latitude-longitude-on-a-3d-sphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!