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.Cloneable
This class represents a 2D vector.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
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:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of the vector.- Overrides:
toString
in classjava.lang.Object
-
-