Class Vector2D


  • public class Vector2D
    extends java.lang.Object
    • Constructor Detail

      • Vector2D

        public Vector2D​(double x,
                        double y)
    • Method Detail

      • getX

        public double getX()
      • getY

        public double getY()
      • toUnitVector

        public Vector2D toUnitVector()
      • length

        public double length()
      • scale

        public Vector2D scale​(double scale)
      • dotProduct

        public double dotProduct​(Vector2D other)
      • cwNormal

        public Vector2D cwNormal()
        The normal vector of same size in clock wise direction.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object