|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.coordinate.Vector
A 3 dimensional vector implemented with double precision floating point values.
| Field Summary | |
static int |
X
Index of the X-axis coordinate, used in array representations of the coordinate axis values. |
static int |
Y
Index of the Y-axis coordinate, used in array representations of the coordinate axis values. |
static int |
Z
Index of the Z-axis coordinate, used in array representations of the coordinate axis values. |
| Constructor Summary | |
Vector()
Construct a new vector with values (0, 0, 0) |
|
Vector(double[] vec)
Construct a new vector initialized with the specified values |
|
Vector(double x,
double y,
double z)
Construct a new vector initialized with the specified values |
|
Vector(float[] vec)
Construct a new vector initialized with the specified values |
|
Vector(Vector arg)
Construct a new vector duplicating the passed argument |
|
| Method Summary | |
void |
clear()
Clear the values of the vector |
static Vector |
cross(Vector a,
Vector b)
Return the cross product of two vectors |
double |
dot(Vector v)
Return the value of the dot product of this vector and the argument |
boolean |
equals(java.lang.Object obj)
Check the vector for equality with the passed object. |
double[] |
get()
Return the values of the vector |
double |
get(Axis axis)
Get the vector value along an axis |
void |
get(double[] value)
Get the double values of the vector |
void |
get(float[] value)
Get the float values of the vector |
int |
hashCode()
Calculate the hash code |
double |
magnitude()
Return the magnitude of the vector |
void |
negate()
Change the sign of each coordinate point |
void |
negate(Axis axis)
Change the sign of the coordinate point on the specified Axis |
void |
normalize()
Normalize the vector values |
void |
scale(double arg)
Multiply each vector value by the passed argument |
void |
set(Axis axis,
double value)
Set the vector value along an axis |
void |
set(double[] vec)
Set the values of the vector |
void |
set(double x,
double y,
double z)
Set the value of the vector |
void |
set(float[] vec)
Set the values of the vector |
java.lang.String |
toString()
Return a string representing the vector of the form "x, y, z" |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int X
public static final int Y
public static final int Z
| Constructor Detail |
public Vector()
public Vector(Vector arg)
arg - the vector to duplicate
public Vector(double x,
double y,
double z)
x - the x valuey - the y valuez - the z valuepublic Vector(double[] vec)
vec - the double array of valuespublic Vector(float[] vec)
vec - the float array of values| Method Detail |
public double magnitude()
public void normalize()
public void set(double x,
double y,
double z)
x - the x valuey - the y valuez - the z valuepublic void set(double[] vec)
vec - the double array of valuespublic void set(float[] vec)
vec - the float array of valuespublic void clear()
public void negate()
public void negate(Axis axis)
Axis
axis - the Axis identifierpublic double[] get()
double array of vector valuespublic void get(double[] value)
double values of the vector
value - the double array to be initialized with the values
in X, Y, and Z axis orderpublic void get(float[] value)
float values of the vector
value - the float array to be initialized with the values
in X, Y, and Z axis orderpublic double get(Axis axis)
axis - the Axis identifier
double value for the X, Y or Z axis
public void set(Axis axis,
double value)
axis - the Axis identifiervalue - the double value for the X, Y or Z axispublic void scale(double arg)
arg - the multiplier
public static Vector cross(Vector a,
Vector b)
a - the first vectorb - the second vectorpublic double dot(Vector v)
v - the argument vector
public int hashCode()
public boolean equals(java.lang.Object obj)
true if the values of the vector are identical,
false otherwisepublic java.lang.String toString()
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||