1 /** 2 * A test program for the GeographicLib.Geodesic.Direct method 3 **********************************************************************/ 4 5 import java.util.*; 6 import net.sf.geographiclib.*; 7 public class Direct { 8 /** 9 * Solve the direct geodesic problem. 10 * 11 * This program reads in lines with lat1, lon1, azi1, s12 and prints out lines 12 * with lat2, lon2, azi2 (for the WGS84 ellipsoid). 13 **********************************************************************/ main(String[] args)14 public static void main(String[] args) { 15 try { 16 Scanner in = new Scanner(System.in); 17 double lat1, lon1, azi1, s12; 18 while (true) { 19 lat1 = in.nextDouble(); lon1 = in.nextDouble(); 20 azi1 = in.nextDouble(); s12 = in.nextDouble(); 21 GeodesicData g = Geodesic.WGS84.Direct(lat1, lon1, azi1, s12); 22 System.out.println(g.lat2 + " " + g.lon2 + " " + g.azi2); 23 } 24 } 25 catch (Exception e) {} 26 } 27 } 28