mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
102 lines
3.1 KiB
C#
102 lines
3.1 KiB
C#
// <auto-generated /> - edit Matrix.operators.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
public partial struct double3x2
|
|
{
|
|
/// <inheritdoc cref="Matrix3x2.op_Addition(Matrix3x2, Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3x2 operator +(double3x2 left, double3x2 right)
|
|
{
|
|
double3x2 result;
|
|
|
|
result.X = left.X + right.X;
|
|
result.Y = left.Y + right.Y;
|
|
result.Z = left.Z + right.Z;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_Equality(Matrix3x2, Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool operator ==(double3x2 left, double3x2 right)
|
|
{
|
|
return left.X == right.X && left.Y == right.Y && left.Z == right.Z;
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_Inequality(Matrix3x2, Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool operator !=(double3x2 left, double3x2 right)
|
|
{
|
|
return left.X != right.X || left.Y != right.Y || left.Z != right.Z;
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_Multiply(Matrix3x2, Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3x2 operator *(double3x2 left, double3x2 right)
|
|
{
|
|
double3x2 result;
|
|
|
|
result.X = new double2(
|
|
left.X.X * right.X.X + left.X.Y * right.Y.X,
|
|
left.X.X * right.X.Y + left.X.Y * right.Y.Y
|
|
);
|
|
result.Y = new double2(
|
|
left.Y.X * right.X.X + left.Y.Y * right.Y.X,
|
|
left.Y.X * right.X.Y + left.Y.Y * right.Y.Y
|
|
);
|
|
result.Z = new double2(
|
|
left.Z.X * right.X.X + left.Z.Y * right.Y.X + right.Z.X,
|
|
left.Z.X * right.X.Y + left.Z.Y * right.Y.Y + right.Z.Y
|
|
);
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <inheritdoc cref="Multiply(double3x2, double2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3 operator *(double3x2 matrix, double2 vector)
|
|
{
|
|
return Multiply(matrix, vector);
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_Multiply(Matrix3x2, float)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3x2 operator *(double3x2 left, double right)
|
|
{
|
|
double3x2 result;
|
|
|
|
result.X = left.X * right;
|
|
result.Y = left.Y * right;
|
|
result.Z = left.Z * right;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_Subtraction(Matrix3x2, Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3x2 operator -(double3x2 left, double3x2 right)
|
|
{
|
|
double3x2 result;
|
|
|
|
result.X = left.X - right.X;
|
|
result.Y = left.Y - right.Y;
|
|
result.Z = left.Z - right.Z;
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <inheritdoc cref="Matrix3x2.op_UnaryNegation(Matrix3x2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static double3x2 operator -(double3x2 value)
|
|
{
|
|
double3x2 result;
|
|
|
|
result.X = -value.X;
|
|
result.Y = -value.Y;
|
|
result.Z = -value.Z;
|
|
|
|
return result;
|
|
}
|
|
}
|