Class Vector

java.lang.Object
  extended by Vector

public class Vector
extends java.lang.Object

A simple, two-dimensional vector.


Field Summary
protected  double x
           
protected  double y
           
 
Constructor Summary
Vector(double xValue, double yValue)
           
Vector(int xV, int yV)
           
Vector(Vector v)
           
 
Method Summary
 void add(Vector vectorToAdd)
          Add a vector to this vector.
 double getX()
           
 double getY()
           
 double length()
          Absolute value of the vector, a.
 void set(double xV, double yV)
           
 void setX(double xValue)
           
 void setY(double yValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x

y

protected double y
Constructor Detail

Vector

public Vector(double xValue,
              double yValue)

Vector

public Vector(int xV,
              int yV)

Vector

public Vector(Vector v)
Method Detail

getX

public double getX()

setX

public void setX(double xValue)

getY

public double getY()

setY

public void setY(double yValue)

set

public void set(double xV,
                double yV)

length

public double length()
Absolute value of the vector, a. k. a. length of its arrows.


add

public void add(Vector vectorToAdd)
Add a vector to this vector.