// - edit Vector.math.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct double2
{
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Reflect(double2 vector, double2 normal)
{
return vector - 2 * Dot(vector, normal) * normal;
}
///
[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;
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Transform(double2 position, double4x4 matrix)
{
return double4.Transform(position, matrix).XY;
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 Transform(double2 value, doubleQuat rotation)
{
return double4.Transform(value, rotation).XY;
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double2 TransformNormal(double2 normal, double3x2 matrix)
{
var result = matrix.X * normal.X;
result += matrix.Y * normal.Y;
return result;
}
///
[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;
}
}