mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 21:18:24 +01:00
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
// <auto-generated /> - edit Vector.math-metric.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
public partial struct ulong2
|
|
{
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public readonly double Length()
|
|
{
|
|
return (double)double.Sqrt((double)X * X + (double)Y * Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public readonly ulong LengthSquared()
|
|
{
|
|
return Dot(this, this);
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Distance" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double Distance(ulong2 a, ulong2 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));
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.DistanceSquared" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static ulong DistanceSquared(ulong2 a, ulong2 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 ulong Dot(ulong2 a, ulong2 b)
|
|
{
|
|
return a.X * b.X + a.Y * b.Y;
|
|
}
|
|
}
|