Implements the cross/vector product between two 3D vectors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | a(3) |
First vector |
||
real(kind=wp), | intent(in) | :: | b(3) |
Second vector |
Orthogonal vector
pure function crossprod(a,b) result(c) !> First vector real(wp), intent(in) :: a(3) !> Second vector real(wp), intent(in) :: b(3) !> Orthogonal vector real(wp) :: c(3) c(1) = a(2) * b(3) - b(2) * a(3) c(2) = a(3) * b(1) - b(3) * a(1) c(3) = a(1) * b(2) - b(1) * a(2) end function crossprod