Module hw06

Interface IVectorUtil

All Known Implementing Classes:
VectorUtil

public interface IVectorUtil
Utilities for working with 2-D vectors.
Author:
swong
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Utility method to get the signed angle between the two 2-D vectors.
    void
    rotate​(Point2D v, double angle)
    Utility method to rotate the given vector by the given angle the input vector is mutated.
  • Method Details

    • rotate

      void rotate(Point2D v, double angle)
      Utility method to rotate the given vector by the given angle the input vector is mutated. Works with both Points and Point2D.Doubles.
      Parameters:
      v - A 2-D vector
      angle - Angle to rotate by in radians
    • angleBetween

      double angleBetween(Point2D v1, Point2D v2)
      Utility method to get the signed angle between the two 2-D vectors. Works with both Points and Point2D.Doubles.
      Parameters:
      v1 - vector #1
      v2 - vector #2
      Returns:
      the angle from v1 to v2