Class RMVector
java.lang.Object
com.inductiveautomation.rm.graphics.RMVector
- All Implemented Interfaces:
Cloneable
This class represents a 2D vector.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(double X, double Y) Adds the vector components to this vector.Adds a vector.clone()
Returns a basic clone of this object.double
Returns the dot product of the receiver and the given vector.double
Returns the magnitude of the vector.Returns the normalized vector.multiply
(double aValue) Multiply vector by given magnitude.negate()
Makes this receiver point in the opposite direction.Normalizes the vector.toString()
Returns a string representation of the vector.
-
Field Details
-
x
public double x -
y
public double y
-
-
Constructor Details
-
RMVector
public RMVector()Creates a new vector. -
RMVector
public RMVector(double X, double Y) Creates a new vector.
-
-
Method Details
-
add
Adds a vector. -
add
Adds the vector components to this vector. -
normalize
Normalizes the vector. -
negate
Makes this receiver point in the opposite direction. -
multiply
Multiply vector by given magnitude. -
getMagnitude
public double getMagnitude()Returns the magnitude of the vector. -
getDotProduct
Returns the dot product of the receiver and the given vector. -
getNormalized
Returns the normalized vector. -
clone
Returns a basic clone of this object. -
toString
Returns a string representation of the vector.
-