brutal/brutal.numerics/Brutal.Numerics/Vector/long4/long4.math-metric.gen.cs
2026-10-15 14:12:02 +13:00

42 lines
1.4 KiB
C#

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