#include <stdio.h>
#include <stdlib.h>
#include "NavUtils.h"
#include "MathP.h"

int main(int argc, char **argv)
{
  if (argc != 4) {
    fprintf(stderr, "usage: %s lat lon utmZone\n", argv[0]);
    return 1;
  }

  double latitude = atof(argv[1]) * Math::RadsPerDeg;
  double longitude = atof(argv[2]) * Math::RadsPerDeg;
  long utmZone = atoi(argv[3]);

  double northing, easting;

  NavUtils::geoToUtm(latitude, longitude, utmZone, &northing, &easting);

  printf("UTM: northing=%.2f  easting=%.2f\n", northing, easting);

  NavUtils::utmToGeo(northing, easting, utmZone, &latitude, &longitude);

  printf("Geographic: latitude=%.2f  longitude=%.2f\n", 
	 latitude / Math::RadsPerDeg, longitude / Math::RadsPerDeg);

  return 0;
}

