brutal/Brutal.Numerics/Vector/sbyte2/sbyte2.math-metric.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

42 lines
1.2 KiB
C#

// <auto-generated /> - edit Vector.math-metric.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct sbyte2
{
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly float Length()
{
return (float)double.Sqrt((double)X * X + (double)Y * Y);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly int LengthSquared()
{
return Dot(this, this);
}
/// <inheritdoc cref="Vector2.Distance" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Distance(sbyte2 a, sbyte2 b)
{
return (float)double.Sqrt(((double)a.X - b.X) * ((double)a.X - b.X) + ((double)a.Y - b.Y) * ((double)a.Y - b.Y));
}
/// <inheritdoc cref="Vector2.DistanceSquared" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int DistanceSquared(sbyte2 a, sbyte2 b)
{
return (a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y);
}
/// <inheritdoc cref="Vector2.Dot" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int Dot(sbyte2 a, sbyte2 b)
{
return a.X * b.X + a.Y * b.Y;
}
}