Class RMVector

java.lang.Object
com.inductiveautomation.rm.graphics.RMVector
All Implemented Interfaces:
Cloneable

public class RMVector extends Object implements Cloneable
This class represents a 2D 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

      public RMVector add(RMVector aVector)
      Adds a vector.
    • 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 class Object
    • toString

      public String toString()
      Returns a string representation of the vector.
      Overrides:
      toString in class Object