|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--velvec
This class was written to provide support for using 2-Dimensional vectors. The name "velvec" is short for Velocity Vector. The primary function of the class is to provide a convenient way of representing various vectors. The class allows a 2D vector to be set or read as: 0. Polar format (Magnitude, Direction) (Direction expressed in degrees) 1. Component format (x,y). 2. Polar format (Magnitude, Direction) (Direction expressed in radians) velvec stores the vector information as a length 5 array of doubles. The class defines the position of each piece of infomation using static integer tags and holds a static reference to the Useful_Functions class for the purpose of using both the mod and string split functions.
| Constructor Summary | |
velvec()
Purpose: Default Constructor |
|
velvec(double x,
double y,
int option)
Purpose: Initializing Constructor |
|
| Method Summary | |
java.lang.String |
collapse()
Purpose: Collapses the velvec into a string with a delimiter between the two values This is used when packing the vector into a string for network transmission Roughly the equivalent of toString() in Java standard classes Returns: String Concat of the minimal representation of the vector (2 values, xy components) delimited with a "#" |
void |
copy(velvec orig)
Purpose: Set velvec object to exactly match the Original velvec object passed to it. |
void |
expand(java.lang.String data)
Purpose: Expand a collapsed velvec into its rich internal format. |
double |
gddir()
Purpose: Give public access to the Degree Direction value of this vector Returns: velvec vector Degree Direction |
double |
gmag()
Purpose: Give public access to the Magnitude value of this vector Returns: velvec vector Magnitude |
double |
grdir()
Purpose: Give public access to the Radian Direction value of this vector Returns: velvec vector Radian Direction |
double |
gxc()
Purpose: Give public access to the X-Component value of this vector Returns: velvec vector X-Component |
double |
gyc()
Purpose: Give public access to the Y-Component value of this vector Returns: velvec vector Y-Component |
void |
invx()
Purpose: Inverts the X-Component of the vector (rotates 180 degrees) |
void |
invy()
Purpose: Inverts the Y-Component of the vector (rotates 180 degrees) |
java.lang.String |
print()
Purpose: Print out the entire contents of the velvec Returns: String Concat of the minimal representation of the vector (2 values, xy components) |
java.lang.String |
print2()
Purpose: Return String representatoin of vector Returns: String Concat of the minimal representation of the vector (2 values, xy components) |
void |
setvec(double x,
double y,
int option)
Purpose: Sets the vector to a new direction and magnitude. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public velvec()
public velvec(double x,
double y,
int option)
| Method Detail |
public void setvec(double x,
double y,
int option)
public java.lang.String print()
public java.lang.String print2()
public java.lang.String collapse()
public void expand(java.lang.String data)
public double gmag()
public double grdir()
public double gddir()
public double gxc()
public double gyc()
public void invy()
public void invx()
public void copy(velvec orig)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||