Implements 3D vector of continuous spatial coordinates. Can be used to store Continuous coordinates or Movement vectors. More...
Public Member Functions | |
ContinuousVector () | |
Default Constructor - constructs a ContinuousVector with points at 0,0,0. More... | |
ContinuousVector (ContinuousVector aCC) | |
Constructs a continuous vector with points specified by a provided continuous vector. More... | |
ContinuousVector (Element xmlRoot) | |
Constructs a continuous vector with points specified from XML tags. More... | |
ContinuousVector (DiscreteVector dC, double res) | |
Translate a discrete coordinates expressed on a discrete spatial grid with the resolution res to form continuous vector. More... | |
ContinuousVector (double x, double y, double z) | |
Create a continuous vector from three provided points. More... | |
void | set (ContinuousVector cc) |
Set this vector to the points contained in a supplied continuous vector. More... | |
void | set (double x, double y, double z) |
Set this vector to the supplied X,Y,Z points. More... | |
void | reset () |
Set all points in the vector to zero. More... | |
boolean | isValid () |
Determine whether the numeric points in this vector are valid. More... | |
void | turnAround () |
boolean | equals (double x, double y, double z) |
Determine if this vector is in the location giving by the points X,Y,Z. More... | |
boolean | isZero () |
Determine if all points in the vector are zero. More... | |
String | toString () |
Print coordinates to string. More... | |
void | add (ContinuousVector v) |
Add vector v to this continuous vector. More... | |
void | add (double x, double y, double z) |
Add points X,Y,Z to their respective point in this vector. More... | |
void | sendSum (ContinuousVector a, ContinuousVector b) |
Store in this vector the sum of two other continuous vectors. More... | |
void | subtract (ContinuousVector v) |
Subtract vector v from this continuous vector. More... | |
void | sendDiff (ContinuousVector a, ContinuousVector b) |
Store in this vector the subtraction of two other continuous vectors. More... | |
double | prodScalar (ContinuousVector cc) |
Calculate scalar product (dot product) of this vector with vector cc supplied. More... | |
void | times (double multiplier) |
Multiply (stretch) this vector by supplied multiplier. More... | |
void | alea (boolean is3D) |
Set this vector to a random coordinate (x,y,z) More... | |
void | normalizeVector () |
void | normalizeVector (double newLength) |
Normalize this Vector to a given length. More... | |
double | distance (ContinuousVector cc) |
Calculate and return the absolute distance to a vector expressed in cc. More... | |
double | norm () |
Return absolute length. More... | |
double | cosAngle (ContinuousVector cc) |
Calculate cosine of the angle to vector cc. More... | |
Object | clone () throws CloneNotSupportedException |
Clone this vector, if supported. More... | |
Public Attributes | |
double | x |
double | y |
double | z |
Implements 3D vector of continuous spatial coordinates. Can be used to store Continuous coordinates or Movement vectors.
Implements 3D vector of continuous spatial coordinates. Can be used to store Continuous coordinates or Movement vectors
simulator.geometry.ContinuousVector.ContinuousVector | ( | ) |
Default Constructor - constructs a ContinuousVector with points at 0,0,0.
Default Constructor - constructs a ContinuousVector with points at 0,0,0
simulator.geometry.ContinuousVector.ContinuousVector | ( | ContinuousVector | aCC | ) |
Constructs a continuous vector with points specified by a provided continuous vector.
Constructs a continuous vector with points specified by a provided continuous vector
aCC | ContinuousVector which to initialise the points from |
simulator.geometry.ContinuousVector.ContinuousVector | ( | Element | xmlRoot | ) |
Constructs a continuous vector with points specified from XML tags.
Constructs a continuous vector with points specified from XML tags
xmlRoot | Set of XML tags containing an X,Y,and Z coordinate |
simulator.geometry.ContinuousVector.ContinuousVector | ( | DiscreteVector | dC, |
double | res | ||
) |
Translate a discrete coordinates expressed on a discrete spatial grid with the resolution res to form continuous vector.
Translate a discrete coordinates expressed on a discrete spatial grid with the resolution res to form continuous vector
dC | Discrete vector containing points on a grid |
res | The resolution of this grid, to use to transform these points |
simulator.geometry.ContinuousVector.ContinuousVector | ( | double | x, |
double | y, | ||
double | z | ||
) |
Create a continuous vector from three provided points.
Create a continuous vector from three provided points
x | X coordinate |
y | Y coordinate |
z | Z coordinate |
void simulator.geometry.ContinuousVector.add | ( | ContinuousVector | v | ) |
Add vector v to this continuous vector.
Add vector v to this continuous vector
v | ContinuousVector to add to this vector |
void simulator.geometry.ContinuousVector.add | ( | double | x, |
double | y, | ||
double | z | ||
) |
Add points X,Y,Z to their respective point in this vector.
Add points X,Y,Z to their respective point in this vector
x | X coordinate |
y | Y coordinate |
z | Z coordinater |
void simulator.geometry.ContinuousVector.alea | ( | boolean | is3D | ) |
Set this vector to a random coordinate (x,y,z)
Set this vector to a random coordinate (x,y,z)
is3D | Boolean noting if a Z coordinate needs to be calculated (if domain is 3D) |
Object simulator.geometry.ContinuousVector.clone | ( | ) | throws CloneNotSupportedException |
Clone this vector, if supported.
Clone this vector, if supported
CloneNotSupportedException | Thrown if the object cannot be cloned |
double simulator.geometry.ContinuousVector.cosAngle | ( | ContinuousVector | cc | ) |
Calculate cosine of the angle to vector cc.
Calculate cosine of the angle to vector cc
cc | ContinuousVector for which cosine of the angle to this one should be calculated |
double simulator.geometry.ContinuousVector.distance | ( | ContinuousVector | cc | ) |
Calculate and return the absolute distance to a vector expressed in cc.
Calculate and return the absolute distance to a vector expressed in cc
cc | ContinuousVector to calculate distance to |
boolean simulator.geometry.ContinuousVector.equals | ( | double | x, |
double | y, | ||
double | z | ||
) |
Determine if this vector is in the location giving by the points X,Y,Z.
Determine if this vector is in the location giving by the points X,Y,Z
x | X coordinate |
y | Y coordinate |
z | Z coordinate |
boolean simulator.geometry.ContinuousVector.isValid | ( | ) |
Determine whether the numeric points in this vector are valid.
Determine whether the numeric points in this vector are valid
boolean simulator.geometry.ContinuousVector.isZero | ( | ) |
Determine if all points in the vector are zero.
Determine if all points in the vector are zero
double simulator.geometry.ContinuousVector.norm | ( | ) |
Return absolute length.
Return absolute length
void simulator.geometry.ContinuousVector.normalizeVector | ( | ) |
Normalize this Vector to unit length.
void simulator.geometry.ContinuousVector.normalizeVector | ( | double | newLength | ) |
Normalize this Vector to a given length.
Normalize this Vector to a given length.
newLength | Length used to normalise vector |
double simulator.geometry.ContinuousVector.prodScalar | ( | ContinuousVector | cc | ) |
Calculate scalar product (dot product) of this vector with vector cc supplied.
Calculate scalar product (dot product) of this vector with vector cc supplied
cc | Continuous vector to multiply (dot product) with this vector |
void simulator.geometry.ContinuousVector.reset | ( | ) |
Set all points in the vector to zero.
Set all points in the vector to zero
void simulator.geometry.ContinuousVector.sendDiff | ( | ContinuousVector | a, |
ContinuousVector | b | ||
) |
Store in this vector the subtraction of two other continuous vectors.
Store in this vector the subtraction of two other continuous vectors
a | First continuous vector |
b | Continuous vector to subtract from the first |
void simulator.geometry.ContinuousVector.sendSum | ( | ContinuousVector | a, |
ContinuousVector | b | ||
) |
Store in this vector the sum of two other continuous vectors.
Store in this vector the sum of two other continuous vectors
a | First continuous vector |
b | Continuous vector to add to first |
void simulator.geometry.ContinuousVector.set | ( | ContinuousVector | cc | ) |
Set this vector to the points contained in a supplied continuous vector.
Set this vector to the points contained in a supplied continuous vector
cc | Continuous vector of points to set this vector to |
void simulator.geometry.ContinuousVector.set | ( | double | x, |
double | y, | ||
double | z | ||
) |
Set this vector to the supplied X,Y,Z points.
Set this vector to the supplied X,Y,Z points
x | X coordinate |
y | Y coordinate |
z | Z coordinate |
void simulator.geometry.ContinuousVector.subtract | ( | ContinuousVector | v | ) |
Subtract vector v from this continuous vector.
Subtract vector v from this continuous vector
v | ContinuousVector to subtract from this vector |
void simulator.geometry.ContinuousVector.times | ( | double | multiplier | ) |
Multiply (stretch) this vector by supplied multiplier.
Multiply (stretch) this vector by supplied multiplier
multiplier | Amount to stretch this vector by |
String simulator.geometry.ContinuousVector.toString | ( | ) |
Print coordinates to string.
Print coordinates to string
void simulator.geometry.ContinuousVector.turnAround | ( | ) |
Changes the sign of the vector. Used for movement vectors.
double simulator.geometry.ContinuousVector.x |
X coordinate of the point contained in this vector
double simulator.geometry.ContinuousVector.y |
Y coordinate of the point contained in this vector
double simulator.geometry.ContinuousVector.z |
Z coordinate of the point contained in this vector