function that calculates the cross product between two real 3-dimensional vectors and 1
the wedge notation can sometimes be used to denote the vector product. ↩
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | DIMENSION(3) | :: | a | |||
real(kind=dp), | DIMENSION(3) | :: | b |
FUNCTION cross(a,b) RESULT(result) REAL(dp), DIMENSION(3) :: a, b REAL(dp), DIMENSION(3) :: result result(1) = a(2) * b(3) - b(2) * a(3) result(2) = - (a(1) * b(3) - b(1) * a(3)) result(3) = a(1) * b(2) - b(1) * a(2) END FUNCTION cross