/* Author: CPSC 111 Jan 2010
 * Date: Fri Jan 29 2010
 * Point: find distance between two points
 * 
 * We have written some code, but have not compiled or tested it yet.
 *
 */

public class Point {

    private double x;
    private double y;

    public Point(double inX, double inY) {
	x = inX;
	y = inY;
    }

    // could we just name the input parameters by the real names? yes,
    // if we use "this" to distinguish between the fields of the
    // object and the passed-in parameters
    /*
    public Point(double x, double y) {
	this.x = x;
	this.y = y;
    }
    */

    public Point(x,y) {} // can we do this? no, too bad...

    public distanceBetween(Point otherPoint) {

	double distance = Math.sqrt(
	     (otherPoint.getX() - x)*(otherPoint.getX() - x) +
	     (otherPoint.getY() - y)*(otherPoint.getY() - y)
	     );
	// do we have to use Math.sqrt? or just sqrt?
	return distance;
    }

}
