# Generate geographic coordinates given a vertex in a sphere

This topic is 4309 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I need a way to get the geographic coordinates (longitude and latitude) of a selected vertex in a sphere. Does anybody know of any material on this subject? Thanks.

##### Share on other sites
Geographic coordinates are virtually the same as spherical polar coordinates. The differences are superficial:
1. It is often assumed that the normalised altitude (cf. radius) is 1.
2. Angles are taken to run from 0° to 360° and -90° to 90°, using imperial degrees-minutes-seconds rather than 0 to 2p in a decimal expansion.

Assuming the sphere is centred at the origin (if it isn't, translate), has radius r, and has poles at (0, r, 0) and (0, -r, 0):

φ = arccos(y/r)
θ = arctan(z/x)

(If you're working in C or C++, you should want to use atan2(y, x) rather than atan(y/x)).

This will get you to spherical polar coordinates. To convert this to geographics:

lat = φ * (180 / Pi) - 90
lon = θ * (180 / Pi)

The conversion into minutes has as much to do with string-processing as mathematics, so I take it you're not interested.

1. 1
Rutin
36
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633344
• Total Posts
3011438
• ### Who's Online (See full list)

There are no registered users currently online

×