Given latitude ,longitude, bearing and distance find second coordinates
Answers
Answer:
Step-by-step explanation:
As noted in comments, your formulas expect that the latitude, longitude, true course, and distance are all in radians.
If you want to pass in latitude, longitude, true course in degrees, and distance in nautical miles, you will need to do the following conversion below any math:
// convert to radians
lat1 = lat1 * Math.PI / 180;
lon1 = lon1 * Math.PI / 180;
tc = tc * Math.PI / 180;
d = (Math.PI / (180*60)) * d;
and then convert your latitude and longitude back from radians to degrees:
// convert to degrees
lat = lat * 180 / Math.PI;
lon = lon * 180 / Math.PI;
However, two other notes:
1) java.awt.Point (not clear this is what you're using) can only hold integers; you might want to use Point2D.Double instead; and
2) Distance should also be measured including fractions of either nautical miles or radians, so should be a double.
With those edits, get(50, 10, 0, 0) will work. As will the worked example from your page for a waypoint 100nm from LAX on the 66 degree radial - get(33.95, 118.4, 66, 100) (remember that minutes are converted into fractional degrees) returns 34.6141 lat and 116.5499 lon, matching 34d 37m and 116d 33m.
Hope it helps you....