diff --git a/src/com/stuypulse/stuylib/math/Vector2D.java b/src/com/stuypulse/stuylib/math/Vector2D.java index 38a7256d..7c052346 100644 --- a/src/com/stuypulse/stuylib/math/Vector2D.java +++ b/src/com/stuypulse/stuylib/math/Vector2D.java @@ -167,6 +167,14 @@ public Vector2D div(double divisor) { return new Vector2D(this.x / divisor, this.y / divisor); } + /** + * @param power power to raise magnitude of vector to + * @return result of raising the magnitude of the vector to the power + */ + public Vector2D pow(double power) { + return this.mul(Math.pow(magnitude(), power - 1)); + } + /** * @param other Vector2D to perform dot product with * @return result of performing the dot product with the other Vector2D