die Berechnung von Lat und Long aus Peilung und Entfernung

Ich habe eine harte Zeit, die Umhüllung meinem Kopf, um etwas Trigonometrie. Ich versuche die Ableitung einer Ziel-Breite und Länge von einem start lat und log und Entfernung und Peilung.

Glücklicherweise fand ich eine erstaunliche Website, die beschreibt genau die Funktion die ich brauche:
http://www.movable-type.co.uk/scripts/latlong.html "Zielpunkt gegeben, Distanz und Peilung vom Startpunkt"
Ich habe versucht, es in meinem java-Programm, aber es ist nicht für mich arbeiten. Ich bereitgestellt, wie die website sagte. Hier ist mein code:

double dist = 150/6371;
double brng = Math.toRadians(90);
double lat1 = Math.toRadians(26.88288045572338);
double lon1 = Math.toRadians(75.78369140625);

double lat2 = Math.asin( Math.sin(lat1)*Math.cos(dist) + Math.cos(lat1)*Math.sin(dist)*Math.cos(brng) );
double a = Math.atan2(Math.sin(brng)*Math.sin(dist)*Math.cos(lat1), Math.cos(dist)-Math.sin(lat1)*Math.sin(lat2));
System.out.println("a = " +  a);
double lon2 = lon1 + a;

lon2 = (lon2+ 3*Math.PI) % (2*Math.PI) - Math.PI;

System.out.println("Latitude = "+Math.toDegrees(lat2)+"\nLongitude = "+Math.toDegrees(lon2));

Aber es zeigt die Ausgabe ist:

a = 0.0
Latitude = 26.882880455723377
Longitude = 75.78369140625

Bin ich nicht immer, wo mache ich die Fehler. Bitte kann jemand mir helfen, herauszufinden, das problem.

Danke im Voraus. 🙂

InformationsquelleAutor der Frage Abhendra Singh | 2012-04-12

Schreibe einen Kommentar