public class RMVector3D
extends java.lang.Object
Constructor and Description |
---|
RMVector3D(double x,
double y,
double z)
Creates a new vector from the given coords.
|
RMVector3D(RMVector3D aVector)
Creates a new vector from the given vector.
|
Modifier and Type | Method and Description |
---|---|
void |
add(RMVector3D aVector)
Add the given vector to this.
|
double |
getAngleBetween(RMVector3D aVector)
Returns the angle between the receiver and the given vector.
|
RMVector3D |
getCrossProduct(RMVector3D v2)
Returns the vector perpendicular to the receiver and the given vector.
|
double |
getDotProduct(RMVector3D v2)
Returns the dot product of the receiver and the given vector.
|
double |
getMagnitude()
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).
|
void |
negate()
Makes this receiver point in the opposite direction.
|
RMVector3D |
normalize()
Makes the vector unit length.
|
java.lang.String |
toString()
Returns a string representation of the vector.
|
RMVector3D |
transform(RMTransform3D aTransform)
Transforms the vector by the given transform3d.
|
public RMVector3D(double x, double y, double z)
public RMVector3D(RMVector3D aVector)
public double getMagnitude()
public RMVector3D normalize()
public void add(RMVector3D aVector)
public RMVector3D getCrossProduct(RMVector3D v2)
public double getDotProduct(RMVector3D v2)
public boolean isAligned(RMVector3D aVector, boolean includePerpendiculars)
public boolean isAway(RMVector3D aVector, boolean includePerpendiculars)
public double getAngleBetween(RMVector3D aVector)
public void negate()
public RMVector3D transform(RMTransform3D aTransform)
public java.lang.String toString()
toString
in class java.lang.Object