SOURCE DUMP v1

This commit is contained in:
Rian Drake 2026-10-15 14:09:11 +13:00
commit fb20299e9d

View file

@ -0,0 +1,43 @@
// <auto-generated /> - edit Vector.math-metric.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct uint2
{
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly float Length()
{
return (float)double.Sqrt((double)X * X + (double)Y * Y);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly uint LengthSquared()
{
return Dot(this, this);
}
/// <inheritdoc cref="Vector2.Distance" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Distance(uint2 a, uint2 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 uint DistanceSquared(uint2 a, uint2 b)
{
var difference = a - b;
return Dot(difference, difference);
}
/// <inheritdoc cref="Vector2.Dot" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Dot(uint2 a, uint2 b)
{
return a.X * b.X + a.Y * b.Y;
}
}