public class RMVector
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
RMVector()
Creates a new vector.
|
RMVector(double X,
double Y)
Creates a new vector.
|
Modifier and Type | Method and Description |
---|---|
RMVector |
add(double X,
double Y)
Adds the vector components to this vector.
|
RMVector |
add(RMVector aVector)
Adds a vector.
|
RMVector |
clone()
Returns a basic clone of this object.
|
double |
getDotProduct(RMVector v2)
Returns the dot product of the receiver and the given vector.
|
double |
getMagnitude()
Returns the magnitude of the vector.
|
RMVector |
getNormalized()
Returns the normalized vector.
|
RMVector |
multiply(double aValue)
Multiply vector by given magnitude.
|
RMVector |
negate()
Makes this receiver point in the opposite direction.
|
RMVector |
normalize()
Normalizes the vector.
|
java.lang.String |
toString()
Returns a string representation of the vector.
|
public RMVector()
public RMVector(double X, double Y)
public RMVector add(double X, double Y)
public RMVector normalize()
public RMVector negate()
public RMVector multiply(double aValue)
public double getMagnitude()
public double getDotProduct(RMVector v2)
public RMVector getNormalized()
public RMVector clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object