Engine-Pong/Game/Physics2D/Primitives/Vector2DExtensions.cs

18 lines
1.0 KiB
C#
Raw Normal View History

2024-01-22 12:40:32 +03:00
namespace Syntriax.Engine.Physics2D.Primitives;
public static class Vector2DExtensions
{
public static float Length(this Vector2D vector) => Vector2D.Length(vector);
public static float LengthSquared(this Vector2D vector) => Vector2D.LengthSquared(vector);
2024-01-22 12:53:22 +03:00
public static float Distance(this Vector2D from, Vector2D to) => Vector2D.Distance(from, to);
2024-01-22 12:40:32 +03:00
2024-01-22 18:40:24 +03:00
public static Vector2D Reflect(this Vector2D vector, Vector2D normal) => Vector2D.Reflect(vector, normal);
public static Vector2D Normalize(this Vector2D vector) => Vector2D.Normalize(vector);
2024-01-22 12:41:48 +03:00
public static Vector2D FromTo(this Vector2D from, Vector2D to) => Vector2D.FromTo(from, to);
2024-01-22 12:53:22 +03:00
public static Vector2D Scale(this Vector2D vector, Vector2D scale) => Vector2D.FromTo(vector, scale);
2024-01-22 12:40:32 +03:00
public static float Cross(this Vector2D left, Vector2D right) => Vector2D.Cross(left, right);
public static float AngleBetween(this Vector2D left, Vector2D right) => Vector2D.Angle(left, right);
public static float Dot(this Vector2D left, Vector2D right) => Vector2D.Dot(left, right);
}