Convert spherical polar coordinates to p-vector.
Status: vector/matrix support routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | theta | longitude angle (radians) |
||
real(kind=wp), | intent(in) | :: | phi | latitude angle (radians) |
||
real(kind=wp), | intent(in) | :: | r | radial distance |
||
real(kind=wp), | intent(out), | dimension(3) | :: | p | Cartesian coordinates |
subroutine S2P ( theta, phi, r, p )
implicit none
real(wp),intent(in) :: theta !! longitude angle (radians)
real(wp),intent(in) :: phi !! latitude angle (radians)
real(wp),intent(in) :: r !! radial distance
real(wp),dimension(3),intent(out) :: p !! Cartesian coordinates
real(wp) :: u(3)
call S2C ( theta, phi, u )
call SXP ( r, u, p )
end subroutine S2P