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

60 lines
1.8 KiB
C#

// <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;
}
}