rebelsky.newvec
Interface Vec2D

All Known Implementing Classes:
Point, Polar

public interface Vec2D

A vector in two space.

Version:
1.0
Author:
CSC152 2004F

Method Summary
 double getAngle()
          Get the angle of this vector from the origin.
 double getRadius()
          Get the radius of this vector.
 double getX()
          Get the X coordinate of this vector.
 double getY()
          Get the Y coordinate of this vector.
 Vec2D rotate(double angle)
          Rotate this vector for some amount around the origin.
 Vec2D stretch(double factor)
          Stretch this vector by some amount.
 java.lang.String toString()
          Convert this vector to a string.
 Vec2D unitVector()
          Compute the unit vector for this vector (radius 1, same angle).
 

Method Detail

getX

public double getX()
Get the X coordinate of this vector.


getY

public double getY()
Get the Y coordinate of this vector.


getAngle

public double getAngle()
Get the angle of this vector from the origin.


getRadius

public double getRadius()
Get the radius of this vector.


rotate

public Vec2D rotate(double angle)
Rotate this vector for some amount around the origin.


stretch

public Vec2D stretch(double factor)
Stretch this vector by some amount.


unitVector

public Vec2D unitVector()
Compute the unit vector for this vector (radius 1, same angle).


toString

public java.lang.String toString()
Convert this vector to a string.