Skip to content

Commit

Permalink
Merge pull request #103 from HamletTanyavong/dev
Browse files Browse the repository at this point in the history
Fix determinant calculation for 2x2 matrices
  • Loading branch information
HamletTanyavong authored Apr 23, 2024
2 parents c0ad107 + 6551235 commit c5660c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mathematics.NET/LinearAlgebra/Matrix2x2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public string ToString(string? format, IFormatProvider? provider)
public static Matrix2x2<T> CreateDiagonal(T e11, T e22)
=> new(e11, T.Zero, T.Zero, e22);

public readonly T Determinant() => X1.X1 * X2.X2 - X1.X2 - X2.X1;
public readonly T Determinant() => X1.X1 * X2.X2 - X1.X2 * X2.X1;

public readonly Matrix2x2<T> Inverse()
{
Expand Down

0 comments on commit c5660c8

Please sign in to comment.