Computes the cross product matrix, where:
cross(a,b) == matmul(cross_matrix(a),b)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3) | :: | r |
pure function cross_matrix(r) result(rcross) implicit none real(wp),dimension(3),intent(in) :: r real(wp),dimension(3,3) :: rcross rcross(:,1) = [zero,r(3),-r(2)] rcross(:,2) = [-r(3),zero,r(1)] rcross(:,3) = [r(2),-r(1),zero] end function cross_matrix