betir
Class TwoDVec

java.lang.Object
  |
  +--betir.TwoDVec

public class TwoDVec
extends java.lang.Object

This is a container class that is used for polar and absolute locations.


Constructor Summary
TwoDVec()
           
TwoDVec(int nX, int nY, int nAngle, int fMagnitude)
           
TwoDVec(TwoDVec obj)
           
TwoDVec(TwoDVec p1, TwoDVec p2)
           
 
Method Summary
 void extrapolateNext(float decay)
          use this to extrapolate to the next point
 int getAngle()
           
 int getDistance(TwoDVec obj)
           
 float getMagnitude()
           
 int getX()
           
 int getY()
           
 void rot(int nRot)
           
 void rotPolar(int nRot)
           
 void setAbsolute(int nX, int nY)
           
 void setAngle(int nAngle)
           
 void setDifference(TwoDVec p1, TwoDVec p2)
           
 void setPolar(int nAngle, float fMagnitude)
           
 java.lang.String toStringAbsolute()
           
 java.lang.String toStringPolar()
           
 void updateAbsolute()
           
 void updatePolar()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoDVec

public TwoDVec()

TwoDVec

public TwoDVec(int nX,
               int nY,
               int nAngle,
               int fMagnitude)

TwoDVec

public TwoDVec(TwoDVec obj)

TwoDVec

public TwoDVec(TwoDVec p1,
               TwoDVec p2)
Method Detail

setAbsolute

public void setAbsolute(int nX,
                        int nY)

setPolar

public void setPolar(int nAngle,
                     float fMagnitude)

setAngle

public void setAngle(int nAngle)

setDifference

public void setDifference(TwoDVec p1,
                          TwoDVec p2)

getX

public final int getX()

getY

public final int getY()

getAngle

public final int getAngle()

getMagnitude

public final float getMagnitude()

getDistance

public final int getDistance(TwoDVec obj)

rotPolar

public void rotPolar(int nRot)

rot

public void rot(int nRot)

extrapolateNext

public void extrapolateNext(float decay)
use this to extrapolate to the next point
Parameters:
decay -  

updateAbsolute

public void updateAbsolute()

updatePolar

public void updatePolar()

toStringPolar

public final java.lang.String toStringPolar()

toStringAbsolute

public final java.lang.String toStringAbsolute()