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