Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- Math;
- procedure MidPoint(Lat1, Lon1, Lat2, Lon2: Double; out Lat3, Lon3: Double);
- var
- Bx, By, DLon: Double;
- begin
- DLon := DegToRad(Lon2 - Lon1);
- Lat1 := DegToRad(Lat1);
- Lat2 := DegToRad(Lat2);
- Lon1 := DegToRad(Lon1);
- Bx := Cos(Lat2) * Cos(DLon);
- By := Cos(Lat2) * Sin(DLon);
- Lat3 := RadToDeg(ArcTan2(Sin(Lat1) + Sin(Lat2), Sqrt((Cos(Lat1) + Bx) * (Cos(Lat1) + Bx) + By * By)));
- Lon3 := RadToDeg(Lon1 + ArcTan2(By, Cos(Lat1) + Bx));
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement