Class RMVector
- java.lang.Object
-
- com.inductiveautomation.rm.graphics.RMVector
-
- All Implemented Interfaces:
java.lang.Cloneable
public class RMVector extends java.lang.Object implements java.lang.CloneableThis class represents a 2D vector.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RMVectoradd(double X, double Y)Adds the vector components to this vector.RMVectoradd(RMVector aVector)Adds a vector.RMVectorclone()Returns a basic clone of this object.doublegetDotProduct(RMVector v2)Returns the dot product of the receiver and the given vector.doublegetMagnitude()Returns the magnitude of the vector.RMVectorgetNormalized()Returns the normalized vector.RMVectormultiply(double aValue)Multiply vector by given magnitude.RMVectornegate()Makes this receiver point in the opposite direction.RMVectornormalize()Normalizes the vector.java.lang.StringtoString()Returns a string representation of the vector.
-
-
-
Method Detail
-
add
public RMVector add(double X, double Y)
Adds the vector components to this vector.
-
normalize
public RMVector normalize()
Normalizes the vector.
-
negate
public RMVector negate()
Makes this receiver point in the opposite direction.
-
multiply
public RMVector multiply(double aValue)
Multiply vector by given magnitude.
-
getMagnitude
public double getMagnitude()
Returns the magnitude of the vector.
-
getDotProduct
public double getDotProduct(RMVector v2)
Returns the dot product of the receiver and the given vector.
-
getNormalized
public RMVector getNormalized()
Returns the normalized vector.
-
clone
public RMVector clone()
Returns a basic clone of this object.- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the vector.- Overrides:
toStringin classjava.lang.Object
-
-