package edu.unca.cs.csci202;

/**
 *
 * @author J Dean Brock <brock@unca.edu>
 */
public abstract class Point1080 {
    
    /**
     * Returns the X coordinate of this point.
     * 
     * @return The X coordinate
     */
    abstract public int getX() ;
    
    /**
     * Returns the Y coordinate of this point.
     * 
     * @return The Y coordinate
     */
    abstract public int getY() ;
    
    /**
     * Sets the X coordinate of this point.
     * 
     * @param x New X coordinate
     * @throws IllegalArgumentException if x is negative or greater than 1919
     */
    abstract public void setX(int x) throws IllegalArgumentException ;
    
    /**
     * Sets the Y coordinate of this point.
     * 
     * @param y New Y coordinate
     * @throws IllegalArgumentException if y is negative or greater than 1079
     */
    abstract public void setY(int y) throws IllegalArgumentException ;
    
    public double angle() {
        return Math.atan2((double)getY(), (double)getX()) ;
    }
    
    public double distance() {
        int x = getX() ;
        int y = getY() ;
        return Math.sqrt(x*x + y*y) ;
    }
   
}
