
// Copyright (c) 2001
package uk.co.patrickhaston.mars;

/**
 * A Class class.
 * <P>
 * @author Patrick Haston
 */
public class LatLong extends Object
{

  // Contencts
  public double east;
  public double north;

  /**
   * Constructor
   */
  public LatLong()
  {
    east = 0;
    north = 0;
  }

  public LatLong(LatLong l)
  {
    east = l.east;
    north = l.north;
  }

  public LatLong(double latitude, double longitude)
  {
    east = longitude;
    north = latitude;
  }
  
  public double distanceTo(LatLong loc)
  {
    XYZcoord here = new XYZcoord(this); // The cartesian co-ordinates of this
    XYZcoord there = new XYZcoord(loc); // The cartesian co-ordinates of loc
    
    return here.distanceTo(there);
  }
  
  public boolean isAt(LatLong loc)
  {
    return ((east == loc.east) && (north == loc.north));
  }
}

 
