Package com.deco2800.game.utils.math
Class Vector2Utils
java.lang.Object
com.deco2800.game.utils.math.Vector2Utils
public class Vector2Utils
extends java.lang.Object
Contains additional utility constants and functions for common Vector2 operations.
-
Field Summary
-
Method Summary
Modifier and Type Method Description static double
angleFromTo(Vector2 from, Vector2 to)
Calculate the angle in degrees between two vectorsstatic double
angleTo(Vector2 vector)
Calculate the angle in degrees of a vector.
-
Field Details
-
Method Details
-
angleTo
Calculate the angle in degrees of a vector.- Parameters:
vector
- The vector relative to the origin- Returns:
- Angle in degrees from -180 to 180
-
angleFromTo
Calculate the angle in degrees between two vectors- Parameters:
from
- The vector from which angle is measuredto
- The vector to which angle is measured- Returns:
- Angle in degrees from -180 to 180
-