Project a vector onto a plane.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3) | :: | a |
the original vector |
|
real(kind=wp), | intent(in), | dimension(3) | :: | b |
the plane to project on to (a normal vector) |
the projection of a onto the b plane
pure function vector_projection_on_plane(a,b) result(c) implicit none real(wp),dimension(3),intent(in) :: a !! the original vector real(wp),dimension(3),intent(in) :: b !! the plane to project on to (a normal vector) real(wp),dimension(3) :: c !! the projection of a onto the b plane c = a - vector_projection(a,b) end function vector_projection_on_plane