rp1.rossum
Class RsVector

java.lang.Object
  extended by rp1.rossum.RsVector
All Implemented Interfaces:
java.io.Serializable

public class RsVector
extends java.lang.Object
implements java.io.Serializable

A representation of a 2-element vector with a limited set of vector algebra operations; used for analysis.

See Also:
Serialized Form

Field Summary
static double NEARLY_ZERO
           
 double x
           
 double y
           
 
Constructor Summary
RsVector()
           
RsVector(double _x, double _y)
           
RsVector(RsVector v)
           
 
Method Summary
 RsVector add(RsVector v)
           
 RsVector add(RsVector a, RsVector b)
           
 double dot(RsVector v)
           
 double magnitude()
           
 RsVector normal()
           
 RsVector normal(RsVector v)
           
 RsVector scale(double scalar)
           
 RsVector scale(double scalar, RsVector v)
           
 RsVector subtract(RsVector v)
           
 RsVector subtract(RsVector a, RsVector b)
           
static double turn(RsVector a, RsVector b)
           
 RsVector unit()
           
 RsVector unit(RsVector input)
           
static double unitTurn(RsVector a, RsVector b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x

y

public double y

NEARLY_ZERO

public static final double NEARLY_ZERO
See Also:
Constant Field Values
Constructor Detail

RsVector

public RsVector()

RsVector

public RsVector(RsVector v)

RsVector

public RsVector(double _x,
                double _y)
Method Detail

unit

public RsVector unit()
              throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

unit

public RsVector unit(RsVector input)
              throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

normal

public RsVector normal()

normal

public RsVector normal(RsVector v)

magnitude

public double magnitude()

dot

public double dot(RsVector v)

turn

public static double turn(RsVector a,
                          RsVector b)
                   throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

unitTurn

public static double unitTurn(RsVector a,
                              RsVector b)

add

public RsVector add(RsVector v)

add

public RsVector add(RsVector a,
                    RsVector b)

subtract

public RsVector subtract(RsVector v)

subtract

public RsVector subtract(RsVector a,
                         RsVector b)

scale

public RsVector scale(double scalar)

scale

public RsVector scale(double scalar,
                      RsVector v)