Package 

Class Vector2D


  • 
    public class Vector2D
    
                        

    Represents a vector on a 2-dimensional space.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public double x
      public double y
    • Constructor Summary

      Constructors 
      Constructor Description
      Vector2D(double x, double y) Constructs a new instance of the class.
    • Method Summary

      Modifier and Type Method Description
      double magnitude() Retrieves the vector magnitude (length)
      void Rotate(double angleRadians) Rotates the X,Y coordinates.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Vector2D

        Vector2D(double x, double y)
        Constructs a new instance of the class.
        Parameters:
        x - x value.
        y - y value.
    • Method Detail

      • magnitude

         double magnitude()

        Retrieves the vector magnitude (length)

      • Rotate

         void Rotate(double angleRadians)

        Rotates the X,Y coordinates.

        Parameters:
        angleRadians - rotation angle in radians.