/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Mike
 */
import mccombe.mapping.*;
public class Tester {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        double lat = 58.0 ;
        double lon = 3.0 ;
        Position pos = new Position(new LatLong(lat,lon), 0.0, Ellipsoid.GRS80, Datum.WGS_1984);
//        OSGB zz = new OSGB(pos,Ellipsoid.AIRY, Datum.OSGB_1936);
//        double c1 = zz.gridConvergence();
//        double c2 = zz.gc();
//        System.out.printf("Calc Grid Convergence = %9.6f Measured = %9.6f%n", c1,c2);
//        ENPair pr = z.toEN();
//        System.out.printf("Example 1 E %9.1f N %9.1f%n",pr.east(), pr.north());
        lat = -34.444066  ;
        lon = 172.739194 ;
        LatLong ll = new LatLong(lat, lon);
        System.out.printf("Starting at = %s%n", ll.toString());
        pos = new Position(ll, 0.0, Ellipsoid.INTERNATIONAL, Datum.NZGD_1949);
        NZMG z = new NZMG(pos,Ellipsoid.INTERNATIONAL, Datum.NZGD_1949);
        System.out.printf("Grid convergence = %9.6f%n", Math.toDegrees(z.gridConvergence()));
        ENPair pr = z.toEN();
        System.out.printf("Example 2 E %9.1f N %9.1f%n",pr.east(), pr.north());
        NZMG z2 = new NZMG(pr, Ellipsoid.INTERNATIONAL, Datum.NZGD_1949);
        LatLong latlon = z2.getPosition().toLatLong(Ellipsoid.INTERNATIONAL, Datum.NZGD_1949);
        System.out.printf("Lat Long = %s%n", latlon.toString());

    }

}
