Represents a 3D vector using three doubles. More...
Inheritance diagram for com.mak.vrlj.math.Vector3d:
Collaboration diagram for com.mak.vrlj.math.Vector3d:Public Member Functions | |
| Vector3d () | |
| No-arg constructor. More... | |
| Vector3d (ConstVector3d other) | |
| Copy constructor. More... | |
| Vector3d (ConstVector3f other) | |
| Copy constructor from Vector3f. More... | |
| Vector3d (double x, double y, double z) | |
| Initializing constructor. More... | |
| void | add (ConstVector3d offset) |
| Add another vector to this and store the result in this. More... | |
| double | angle (ConstVector3d other) |
| Compute the angle between 2 vectors. More... | |
| void | assignFrom (ConstVector3d other) |
| Assign new values to this vector from another. More... | |
| void | assignFrom (ConstVector3f other) |
| Assign new values to this vector from a Vector3f. More... | |
| Vector3d | cross (ConstVector3d other) |
| Cross product of 2 vectors. More... | |
| double | distance (ConstVector3d p) |
| Get the distance between 2 3d points. More... | |
| double | dot (ConstVector3d other) |
| Dot product of 2 vectors. More... | |
| boolean | equals (Object obj) |
| double | get (int i) |
| Get vector component by index number, where i=0 for x, i=1 for y and i=2 for z. More... | |
| double | getLength () |
| Get the scalar length of this vector. More... | |
| double | getX () |
| Get the x component. More... | |
| double | getY () |
| Get the y component. More... | |
| double | getZ () |
| Get the z component. More... | |
| int | hashCode () |
| void | multiply (double scalar) |
| Multiply this vector by a scalar and store the result in this. More... | |
| void | normalize () |
| Adjust this vector so that the length is 1, but the direction is unchanged. More... | |
| void | set (int i, double v) |
| Set a vector component by index number, where i=0 for x, i=1 for y and i=2 for z. More... | |
| void | setX (double x) |
| void | setXYZ (double x, double y, double z) |
| Set all vector components. More... | |
| void | setY (double y) |
| void | setZ (double z) |
| void | subtract (ConstVector3d offset) |
| Subtract another vector from this and store the result in this. More... | |
| String | toString () |
| ConstVector3f | toVector3f () |
Static Public Attributes | |
| static final ConstVector3d | zero = new Vector3d(0.0, 0.0, 0.0) |
| A vector with all components 0. More... | |
| static final ConstVector3d | unitX = new Vector3d(1.0, 0.0, 0.0) |
| A unit vector along the x axis. More... | |
| static final ConstVector3d | unitY = new Vector3d(0.0, 1.0, 0.0) |
| A unit vector along the y axis. More... | |
| static final ConstVector3d | unitZ = new Vector3d(0.0, 0.0, 1.0) |
| A unit vector along the z axis. More... | |
Private Attributes | |
| double | myX |
| double | myY |
| double | myZ |
Represents a 3D vector using three doubles.
|
inline |
No-arg constructor.
Referenced by com.mak.vrlj.math.Vector3d.cross(), and com.mak.vrlj.math.Vector3d.equals().
|
inline |
Copy constructor.
| other | source for copy. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
Copy constructor from Vector3f.
| other | source for copy. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
Initializing constructor.
| x | component. |
| y | component. |
| z | component. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
Add another vector to this and store the result in this.
| offset | the value to add to this vector. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inlinevirtual |
Compute the angle between 2 vectors.
| other |
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.dot(), and com.mak.vrlj.math.Vector3d.getLength().
|
inline |
Assign new values to this vector from another.
| other | source for assignment. |
References com.mak.vrlj.math.ConstVector3d.getX(), com.mak.vrlj.math.ConstVector3d.getY(), com.mak.vrlj.math.ConstVector3d.getZ(), com.mak.vrlj.math.Vector3d.setX(), com.mak.vrlj.math.Vector3d.setY(), and com.mak.vrlj.math.Vector3d.setZ().
|
inline |
Assign new values to this vector from a Vector3f.
| other | source for assignment. |
References com.mak.vrlj.math.ConstVector3f.getX(), com.mak.vrlj.math.ConstVector3f.getY(), com.mak.vrlj.math.ConstVector3f.getZ(), com.mak.vrlj.math.Vector3d.setX(), com.mak.vrlj.math.Vector3d.setY(), and com.mak.vrlj.math.Vector3d.setZ().
|
inlinevirtual |
Cross product of 2 vectors.
| other |
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.ConstVector3d.getX(), com.mak.vrlj.math.ConstVector3d.getY(), com.mak.vrlj.math.ConstVector3d.getZ(), com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, com.mak.vrlj.math.Vector3d.myZ, and com.mak.vrlj.math.Vector3d.Vector3d().
|
inlinevirtual |
Get the distance between 2 3d points.
| other | the other position for the difference. |
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.getX(), com.mak.vrlj.math.Vector3d.getY(), and com.mak.vrlj.math.Vector3d.getZ().
|
inlinevirtual |
Dot product of 2 vectors.
| other |
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.ConstVector3d.getY(), com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
Referenced by com.mak.vrlj.math.Vector3d.angle().
|
inline |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, com.mak.vrlj.math.Vector3d.myZ, and com.mak.vrlj.math.Vector3d.Vector3d().
Referenced by com.mak.vrlj.coord.CoordinateTransform.equals(), com.mak.vrlj.coord.DeadReckoner.equals(), com.mak.vrlj.coord.Smoother.equals(), com.mak.vrlj.coord.UtmCoordinate.equals(), com.mak.vrlj.object.Entity.equals(), com.mak.vrlj.object.RadioTransmitter.equals(), and com.mak.vrlj.coord.Smoother.resetPosSmoother().
|
inlinevirtual |
Get vector component by index number, where i=0 for x, i=1 for y and i=2 for z.
| i | index of which vector component to set. |
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
Referenced by com.mak.vrlj.coord.Smoother.initSmootherParams().
|
inlinevirtual |
Get the scalar length of this vector.
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
Referenced by com.mak.vrlj.math.Vector3d.angle(), and com.mak.vrlj.math.Vector3d.normalize().
|
inlinevirtual |
Get the x component.
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.myX.
Referenced by com.mak.vrlj.example.f18.VehicleSim.detonateMunition(), com.mak.vrlj.math.Vector3d.distance(), com.mak.vrlj.coord.Smoother.initSmoothOriParams(), com.mak.vrlj.coord.Smoother.rotAngleAndAxisFromRotMatrix(), com.mak.vrlj.coord.Smoother.rotMatrixFromRotRatesAndTime(), and com.mak.vrlj.coord.Smoother.smoothBodyToGeoc().
|
inlinevirtual |
Get the y component.
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.myY.
Referenced by com.mak.vrlj.example.f18.VehicleSim.detonateMunition(), com.mak.vrlj.math.Vector3d.distance(), com.mak.vrlj.coord.Smoother.initSmoothOriParams(), com.mak.vrlj.coord.Smoother.rotAngleAndAxisFromRotMatrix(), com.mak.vrlj.coord.Smoother.rotMatrixFromRotRatesAndTime(), and com.mak.vrlj.coord.Smoother.smoothBodyToGeoc().
|
inlinevirtual |
Get the z component.
Implements com.mak.vrlj.math.ConstVector3d.
References com.mak.vrlj.math.Vector3d.myZ.
Referenced by com.mak.vrlj.example.f18.VehicleSim.detonateMunition(), com.mak.vrlj.math.Vector3d.distance(), com.mak.vrlj.coord.Smoother.initSmoothOriParams(), com.mak.vrlj.coord.Smoother.rotMatrixFromRotRatesAndTime(), and com.mak.vrlj.coord.Smoother.smoothBodyToGeoc().
|
inline |
|
inline |
Multiply this vector by a scalar and store the result in this.
| scalar | the value to add to this vector. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
Adjust this vector so that the length is 1, but the direction is unchanged.
References com.mak.vrlj.math.Vector3d.getLength(), com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
Set a vector component by index number, where i=0 for x, i=1 for y and i=2 for z.
| i | index of which vector component to set. |
| v | the new value for the indexed component. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
| x | new value for x component. |
References com.mak.vrlj.math.Vector3d.myX.
Referenced by com.mak.vrlj.math.Vector3d.assignFrom().
|
inline |
Set all vector components.
| x | new value for x component. |
| y | new value for y component. |
| z | new value for z component. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
| y | new value for y component. |
References com.mak.vrlj.math.Vector3d.myY.
Referenced by com.mak.vrlj.math.Vector3d.assignFrom().
|
inline |
| z | new value for z component. |
References com.mak.vrlj.math.Vector3d.myZ.
Referenced by com.mak.vrlj.math.Vector3d.assignFrom().
|
inline |
Subtract another vector from this and store the result in this.
| offset | the value to subtract from this vector. |
References com.mak.vrlj.math.Vector3d.myX, com.mak.vrlj.math.Vector3d.myY, and com.mak.vrlj.math.Vector3d.myZ.
|
inline |
|
inlinevirtual |
Implements com.mak.vrlj.math.ConstVector3d.
|
private |
Referenced by com.mak.vrlj.math.Vector3d.add(), com.mak.vrlj.math.Vector3d.cross(), com.mak.vrlj.math.Vector3d.dot(), com.mak.vrlj.math.Vector3d.equals(), com.mak.vrlj.math.Vector3d.get(), com.mak.vrlj.math.Vector3d.getLength(), com.mak.vrlj.math.Vector3d.getX(), com.mak.vrlj.math.Vector3d.hashCode(), com.mak.vrlj.math.Vector3d.multiply(), com.mak.vrlj.math.Vector3d.normalize(), com.mak.vrlj.math.Vector3d.set(), com.mak.vrlj.math.Vector3d.setX(), com.mak.vrlj.math.Vector3d.setXYZ(), com.mak.vrlj.math.Vector3d.subtract(), com.mak.vrlj.math.Vector3d.toString(), and com.mak.vrlj.math.Vector3d.Vector3d().
|
private |
Referenced by com.mak.vrlj.math.Vector3d.add(), com.mak.vrlj.math.Vector3d.cross(), com.mak.vrlj.math.Vector3d.dot(), com.mak.vrlj.math.Vector3d.equals(), com.mak.vrlj.math.Vector3d.get(), com.mak.vrlj.math.Vector3d.getLength(), com.mak.vrlj.math.Vector3d.getY(), com.mak.vrlj.math.Vector3d.hashCode(), com.mak.vrlj.math.Vector3d.multiply(), com.mak.vrlj.math.Vector3d.normalize(), com.mak.vrlj.math.Vector3d.set(), com.mak.vrlj.math.Vector3d.setXYZ(), com.mak.vrlj.math.Vector3d.setY(), com.mak.vrlj.math.Vector3d.subtract(), com.mak.vrlj.math.Vector3d.toString(), and com.mak.vrlj.math.Vector3d.Vector3d().
|
private |
Referenced by com.mak.vrlj.math.Vector3d.add(), com.mak.vrlj.math.Vector3d.cross(), com.mak.vrlj.math.Vector3d.dot(), com.mak.vrlj.math.Vector3d.equals(), com.mak.vrlj.math.Vector3d.get(), com.mak.vrlj.math.Vector3d.getLength(), com.mak.vrlj.math.Vector3d.getZ(), com.mak.vrlj.math.Vector3d.hashCode(), com.mak.vrlj.math.Vector3d.multiply(), com.mak.vrlj.math.Vector3d.normalize(), com.mak.vrlj.math.Vector3d.set(), com.mak.vrlj.math.Vector3d.setXYZ(), com.mak.vrlj.math.Vector3d.setZ(), com.mak.vrlj.math.Vector3d.subtract(), com.mak.vrlj.math.Vector3d.toString(), and com.mak.vrlj.math.Vector3d.Vector3d().
|
static |
A unit vector along the x axis.
|
static |
A unit vector along the y axis.
|
static |
A unit vector along the z axis.
|
static |
A vector with all components 0.
Referenced by com.mak.vrlj.coord.CoordinateTransform.getInverse(), and com.mak.vrlj.coord.Smoother.resetPosSmoother().