diff --git a/src/Math/Fixed/Vector2.cs b/src/Math/Fixed/Vector2.cs
index c2615541..be63811c 100644
--- a/src/Math/Fixed/Vector2.cs
+++ b/src/Math/Fixed/Vector2.cs
@@ -674,6 +674,19 @@ namespace MoonWorks.Math.Fixed
}
}
+ ///
+ /// Rotates a Vector2 by an angle.
+ ///
+ /// The vector to rotate.
+ /// The angle in radians.
+ public static Vector2 Rotate(Vector2 vector, Fix64 angle)
+ {
+ return new Vector2(
+ vector.X * Fix64.Cos(angle) - vector.Y * Fix64.Sin(angle),
+ vector.X * Fix64.Sin(angle) + vector.Y * Fix64.Cos(angle)
+ );
+ }
+
#endregion
#region Public Static Operators
diff --git a/src/Math/Float/Vector2.cs b/src/Math/Float/Vector2.cs
index e9cffb70..e4e52be7 100644
--- a/src/Math/Float/Vector2.cs
+++ b/src/Math/Float/Vector2.cs
@@ -1088,6 +1088,19 @@ namespace MoonWorks.Math.Float
}
}
+ ///
+ /// Rotates a Vector2 by an angle.
+ ///
+ /// The vector to rotate.
+ /// The angle in radians.
+ public static Vector2 Rotate(Vector2 vector, float angle)
+ {
+ return new Vector2(
+ vector.X * (float) System.Math.Cos(angle) - vector.Y * (float) System.Math.Sin(angle),
+ vector.X * (float) System.Math.Sin(angle) + vector.Y * (float) System.Math.Cos(angle)
+ );
+ }
+
#endregion
#region Public Static Operators