wrap_angle Function

public pure elemental function wrap_angle(a) result(r)

Wrap an angle (in rad) from -pi to pi.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a

Return Value real(kind=wp)


Called by

proc~~wrap_angle~~CalledByGraph proc~wrap_angle math_module::wrap_angle proc~halo_to_rv_diffcorr halo_orbit_module::halo_to_rv_diffcorr proc~halo_to_rv_diffcorr->proc~wrap_angle proc~rv_to_orbital_elements orbital_mechanics_module::rv_to_orbital_elements proc~rv_to_orbital_elements->proc~wrap_angle

Source Code

    pure elemental function wrap_angle(a) result(r)

    implicit none

    real(wp),intent(in) :: a
    real(wp)            :: r

    r = mod(a,twopi)
    if (abs(r)>pi) r = r - sign(twopi,r)

    end function wrap_angle