Syntriax.Engine/Engine.Core/Extensions/Vector2DExtensions.cs

35 lines
2.3 KiB
C#
Raw Normal View History

2024-01-22 22:03:56 +03:00
namespace Syntriax.Engine.Core;
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 22:03:56 +03:00
public static float Distance(this Vector2D from, Vector2D to) => Vector2D.Distance(from, to);
public static Vector2D Invert(this Vector2D vector) => Vector2D.Invert(vector);
public static Vector2D Add(this Vector2D vector, Vector2D vectorToAdd) => Vector2D.Add(vector, vectorToAdd);
public static Vector2D Subtract(this Vector2D vector, Vector2D vectorToSubtract) => Vector2D.Subtract(vector, vectorToSubtract);
public static Vector2D Multiply(this Vector2D vector, float value) => Vector2D.Multiply(vector, value);
public static Vector2D Subdivide(this Vector2D vector, float value) => Vector2D.Subdivide(vector, value);
public static Vector2D Abs(this Vector2D vector) => Vector2D.Abs(vector);
2024-01-22 22:03:56 +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);
public static Vector2D FromTo(this Vector2D from, Vector2D to) => Vector2D.FromTo(from, to);
public static Vector2D Scale(this Vector2D vector, Vector2D scale) => Vector2D.Scale(vector, scale);
2024-01-22 22:03:56 +03:00
2024-01-24 12:07:54 +03:00
public static Vector2D Rotate(this Vector2D vector, float angleInRadian) => Vector2D.Rotate(vector, angleInRadian);
2024-01-22 22:03:56 +03:00
public static Vector2D Min(this Vector2D left, Vector2D right) => Vector2D.Min(left, right);
public static Vector2D Max(this Vector2D left, Vector2D right) => Vector2D.Max(left, right);
public static Vector2D Clamp(this Vector2D vector, Vector2D min, Vector2D max) => Vector2D.Clamp(vector, min, max);
public static Vector2D Lerp(this Vector2D from, Vector2D to, float t) => Vector2D.Lerp(from, to, t);
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);
public static bool ApproximatelyEquals(this Vector2D left, Vector2D right, float epsilon = float.Epsilon) => Vector2D.ApproximatelyEquals(left, right, epsilon);
2024-01-22 22:03:56 +03:00
}