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

43 lines
1.3 KiB
C#

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