P2S Subroutine

public subroutine P2S(p, theta, phi, r)

P-vector to spherical polar coordinates.

Status: vector/matrix support routine.

Notes

  1. If P is null, zero THETA, PHI and R are returned.

  2. At either pole, zero THETA is returned.

History

  • IAU SOFA revision: 2006 November 13

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in), dimension(3):: p

p-vector

real(kind=wp), intent(out) :: theta

longitude angle (radians)

real(kind=wp), intent(out) :: phi

latitude angle (radians)

real(kind=wp), intent(out) :: r

radial distance


Calls

proc~~p2s~~CallsGraph proc~p2s P2S proc~c2s C2S proc~p2s->proc~c2s proc~pm PM proc~p2s->proc~pm

Contents

Source Code

P2S

Source Code

    subroutine P2S ( p, theta, phi, r )

    implicit none

    real(wp),dimension(3),intent(in) :: p !! p-vector
    real(wp),intent(out) :: theta !! longitude angle (radians)
    real(wp),intent(out) :: phi !! latitude angle (radians)
    real(wp),intent(out) :: r !! radial distance

    call C2S ( p, theta, phi )
    call PM ( p, r )

    end subroutine P2S