Package com.reportmill.graphics
Class RMVector3D
java.lang.Object
com.reportmill.graphics.RMVector3D
This class represents a 3D vector.
-
Constructor Summary
ConstructorsConstructorDescriptionRMVector3D
(float x, float y, float z) Creates a new vector from the given coords.RMVector3D
(RMVector3D aVector) Creates a new vector from the given vector. -
Method Summary
Modifier and TypeMethodDescriptionadd
(RMVector3D aVector) Add the given vector to this.float
Returns the angle between the receiver and the given vector.Returns the vector perpendicular to the receiver and the given vector.float
Returns the dot product of the receiver and the given vector.float
Returns the magnitude of the vector.boolean
isAligned
(RMVector3D aVector, boolean includePerpendiculars) Returns whether given vector is in same general direction of this (with option to include perpendiculars).boolean
isAway
(RMVector3D aVector, boolean includePerpendiculars) Returns whether given vector is pointing away from the direction of this (with option to include perpendiculars).negate()
Makes this receiver point in the opposite direction.Makes the vector unit length.toString()
Returns a string representation of the vector.transform
(RMTransform3D aTransform) Transforms the vector by the given transform3d.
-
Constructor Details
-
RMVector3D
public RMVector3D(float x, float y, float z) Creates a new vector from the given coords. -
RMVector3D
Creates a new vector from the given vector.
-
-
Method Details
-
getMagnitude
public float getMagnitude()Returns the magnitude of the vector. -
normalize
Makes the vector unit length. -
add
Add the given vector to this. -
getCrossProduct
Returns the vector perpendicular to the receiver and the given vector. -
getDotProduct
Returns the dot product of the receiver and the given vector. -
isAligned
Returns whether given vector is in same general direction of this (with option to include perpendiculars). -
isAway
Returns whether given vector is pointing away from the direction of this (with option to include perpendiculars). -
getAngleBetween
Returns the angle between the receiver and the given vector. -
negate
Makes this receiver point in the opposite direction. -
transform
Transforms the vector by the given transform3d. -
toString
Returns a string representation of the vector.
-