package rebelsky.newvec; /** * A vector in two space. * * @author CSC152 2004F * @version 1.0 */ public interface Vec2D { // +----------+----------------------------------------------------- // | Mutators | // +----------+ // +-----------+---------------------------------------------------- // | Observers | // +-----------+ /** * Get the X coordinate of this vector. */ public double getX(); /** * Get the Y coordinate of this vector. */ public double getY(); /** * Get the angle of this vector from the origin. */ public double getAngle(); /** * Get the radius of this vector. */ public double getRadius(); /** * Rotate this vector for some amount around the origin. */ public Vec2D rotate(double angle); /** * Stretch this vector by some amount. */ public Vec2D stretch(double factor); /** * Compute the unit vector for this vector (radius 1, same * angle). */ public Vec2D unitVector(); /** * Convert this vector to a string. */ public String toString(); } // interface Vec2D