Determinant of 3×3 matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | a(3,3) |
Matrix |
Determinant
pure function matdet_3x3(a) result (det) !> Matrix real(wp), intent(in) :: a(3, 3) !> Determinant real(wp) :: det det = a(1, 1) * a(2, 2) * a(3, 3) & & - a(1, 1) * a(2, 3) * a(3, 2) & & - a(1, 2) * a(2, 1) * a(3, 3) & & + a(1, 2) * a(2, 3) * a(3, 1) & & + a(1, 3) * a(2, 1) * a(3, 2) & & - a(1, 3) * a(2, 2) * a(3, 1) end function matdet_3x3