The cross product a x b.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | a(3) |
the vectors |
||
| real(kind=wp), | intent(in) | :: | b(3) |
the vectors |
pure function cross(a, b) result(c) real(wp), intent(in) :: a(3), b(3) !! the vectors real(wp) :: c(3) c = [a(2) * b(3) - a(3) * b(2), a(3) * b(1) - a(1) * b(3), a(1) * b(2) - a(2) * b(1)] end function cross