Danke,
habe auch diesen Java-Code gefunden:
Code:
double lat1 = (52.523405d * Math.PI) / 180.0d;
double lon1 = (13.411400d * Math.PI) / 180.0d;
double distance = (150000.0d) / 6378388.0d;
double winkel = (208.78d * Math.PI) / 180.0d;
double lat2 = Math.asin(Math.sin(lat1) * Math.cos(distance) + Math.cos(lat1) * Math.sin(distance) * Math.cos(-winkel));
double lon2;
if(Math.cos(lat1) == 0){
lon2 = lon1;
}else{
lon2 = ((lon1 - Math.asin(Math.sin(-winkel) * Math.sin(distance) / Math.cos(lat1)) + Math.PI) % (2*Math.PI)) - Math.PI;
}
lat2 = (lat2 * 180.0d) / Math.PI;
lon2 = (lon2 * 180.0d) / Math.PI;
log.debug("Lat: " + lat2 + " Lon: " + lon2);
Soweit ok, nur wie setzt man das hier in Dephi um:
Code:
lon2 = ((lon1 - Math.asin(Math.sin(-winkel) * Math.sin(distance) / Math.cos(lat1)) + Math.PI) % (2*Math.PI)) - Math.PI;
Das hier funktioniert nicht:
Delphi-Quellcode:
lon2:= lon1 - arcsin(sin(-winkel) * sin(distance) / cos(lat1)) + PI;
lon2:= (lon2 - (Trunc(lon2 / (2*PI)) * (2*PI))) - PI; // falsch
Was macht "%" in Java?