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

View file

@ -0,0 +1,60 @@
// <auto-generated /> - edit Vector.math.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct double2
{
/// <inheritdoc cref="Vector2.Reflect" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Reflect(double2 vector, double2 normal)
{
return vector - 2 * Dot(vector, normal) * normal;
}
/// <inheritdoc cref="Vector2.Transform(Vector2, Matrix3x2)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Transform(double2 position, double3x2 matrix)
{
var result = matrix.X * position.X;
result += matrix.Y * position.Y;
result += matrix.Z;
return result;
}
/// <inheritdoc cref="Vector2.Transform(Vector2, Matrix4x4)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Transform(double2 position, double4x4 matrix)
{
return double4.Transform(position, matrix).XY;
}
/// <inheritdoc cref="Vector2.Transform(Vector2, Quaternion)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Transform(double2 value, doubleQuat rotation)
{
return double4.Transform(value, rotation).XY;
}
/// <inheritdoc cref="Vector2.TransformNormal(Vector2, Matrix3x2)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 TransformNormal(double2 normal, double3x2 matrix)
{
var result = matrix.X * normal.X;
result += matrix.Y * normal.Y;
return result;
}
/// <inheritdoc cref="Vector2.TransformNormal(Vector2, Matrix4x4)" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 TransformNormal(double2 normal, double4x4 matrix)
{
var result = matrix.X * normal.X;
result += matrix.Y * normal.Y;
return result.XY;
}
}