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) |
|
real(kind=wp), | intent(out), | dimension(3) | :: | c |
the projection of a onto the b plane |
pure subroutine vector_projection_on_plane(a,b,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),intent(out) :: c !! the projection of a onto the b plane c = a - vector_projection(a,b) end subroutine vector_projection_on_plane