Class Vector2D

java.lang.Object
  extended by CoordinatePair
      extended by Vector2D
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Complex, PolarVector2D

public class Vector2D
extends CoordinatePair


Field Summary
static int ANGLE
           
static int LENGTH
           
static Vector2D NaN
           
static int NORM
           
 
Fields inherited from class CoordinatePair
x, X, y, Y
 
Constructor Summary
Vector2D()
           
Vector2D(double X, double Y)
           
Vector2D(java.lang.String text)
           
Vector2D(Vector2D template)
           
 
Method Summary
 void add(Vector2D v)
           
 void addMultipleOf(Vector2D vector, double factor)
           
 double angle()
           
static Vector2D difference(Vector2D a, Vector2D b)
           
 double distanceTo(Vector2D point)
           
 double dot(Vector2D v)
           
static double dot(Vector2D v1, Vector2D v2)
           
static double getAngle(double x, double y)
           
 double getValue(int field)
           
 Vector2D inverseOf(Vector2D v)
           
 void invert()
           
 double length()
           
 void math(char op, double b)
           
 void math(char op, Vector2D v)
           
static Vector2D math(Vector2D a, char op, double b)
           
static Vector2D math(Vector2D a, char op, Vector2D b)
           
 double norm()
           
 void normalize()
           
 Vector2D normalized(Vector2D v)
           
 PolarVector2D polar()
           
 Vector2D project(Vector2D v1, Vector2D v2)
           
 void projectOn(Vector2D v)
           
 Vector2D reflect(Vector2D v1, Vector2D v2)
           
 void reflectOn(Vector2D v)
           
 void rotate(double alpha)
           
 void scale(double value)
           
 void setValue(int field, double value)
           
 void subtract(Vector2D v)
           
static Vector2D sum(Vector2D a, Vector2D b)
           
 
Methods inherited from class CoordinatePair
clone, copy, createFromDoubles, equals, equals, isNaN, isNull, NaN, parse, set, toString, toString, viewAsDoubles, viewAsDoubles, weightedAverageWith, zero
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LENGTH

public static final int LENGTH
See Also:
Constant Field Values

NORM

public static final int NORM
See Also:
Constant Field Values

ANGLE

public static final int ANGLE
See Also:
Constant Field Values

NaN

public static final Vector2D NaN
Constructor Detail

Vector2D

public Vector2D()

Vector2D

public Vector2D(java.lang.String text)

Vector2D

public Vector2D(double X,
                double Y)

Vector2D

public Vector2D(Vector2D template)
Method Detail

add

public void add(Vector2D v)

sum

public static Vector2D sum(Vector2D a,
                           Vector2D b)

subtract

public void subtract(Vector2D v)

addMultipleOf

public void addMultipleOf(Vector2D vector,
                          double factor)

difference

public static Vector2D difference(Vector2D a,
                                  Vector2D b)

scale

public void scale(double value)

rotate

public void rotate(double alpha)

dot

public double dot(Vector2D v)

dot

public static double dot(Vector2D v1,
                         Vector2D v2)

norm

public double norm()

length

public double length()

angle

public double angle()

getAngle

public static double getAngle(double x,
                              double y)

normalize

public void normalize()
               throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

normalized

public Vector2D normalized(Vector2D v)

invert

public void invert()

inverseOf

public Vector2D inverseOf(Vector2D v)

project

public Vector2D project(Vector2D v1,
                        Vector2D v2)

projectOn

public void projectOn(Vector2D v)

reflect

public Vector2D reflect(Vector2D v1,
                        Vector2D v2)

reflectOn

public void reflectOn(Vector2D v)

polar

public PolarVector2D polar()

math

public void math(char op,
                 Vector2D v)
          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

math

public static Vector2D math(Vector2D a,
                            char op,
                            Vector2D b)
                     throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

math

public void math(char op,
                 double b)
          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

math

public static Vector2D math(Vector2D a,
                            char op,
                            double b)
                     throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getValue

public double getValue(int field)
                throws java.lang.NoSuchFieldException
Overrides:
getValue in class CoordinatePair
Throws:
java.lang.NoSuchFieldException

setValue

public void setValue(int field,
                     double value)
              throws java.lang.NoSuchFieldException
Overrides:
setValue in class CoordinatePair
Throws:
java.lang.NoSuchFieldException

distanceTo

public double distanceTo(Vector2D point)