# geodesic calculation.

Lat/lon given radial and distance A point {lat,lon} is a distance d out on the tc radial from point 1 if:     lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))     IF (cos(lat)=0)         lon=lon1      // endpoint a pole     ELSE         lon=mod(lon1-asin(sin(tc)*sin(d)/cos(lat))+pi,2*pi)-pi     ENDIF This algorithm is limited to distances such that dlon <pi/2, i.e those that extend around less than one quarter of the circumference of the earth in longitude. A completely general, but more complicated algorithm is necessary if greater distances are allowed:     lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))     dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat))     lon=mod( lon1-dlon +pi,2*pi )-pi
Assuming that tc is measured in degrees, then so is d. The actual "distance" would then be given by $d\left(\frac{\pi}{180}\right)R$ where R is the radius of the earth and is in whatever units R is measured in.