Returns the cross product of two vectors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x(3) |
Input vector |
||
| real(kind=wp), | intent(in) | :: | y(3) |
Input vector |
Result
pure function cross_product(x,y) result(z) !> Returns the cross product of two vectors. implicit none real(wp), intent(in) :: x(3) !! Input vector real(wp), intent(in) :: y(3) !! Input vector real(wp) :: z(3) !! Result z(1)=x(2)*y(3)-x(3)*y(2) z(2)=x(3)*y(1)-x(1)*y(3) z(3)=x(1)*y(2)-x(2)*y(1) return end function cross_product