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