sky_direction Function

private pure function sky_direction(ra, dec) result(dir)

The unit vector of a direction on the sky from its right ascension (hours) and declination (degrees), as the stars' (star_to_point).

Arguments

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

right ascension (hours)

real(kind=wp), intent(in) :: dec

declination (degrees)

Return Value real(kind=wp), (3)


Called by

proc~~sky_direction~~CalledByGraph proc~sky_direction sky_direction proc~read_constellations read_constellations proc~read_constellations->proc~sky_direction proc~set_constellations SkySphere%set_constellations proc~set_constellations->proc~read_constellations

Source Code

    pure function sky_direction(ra, dec) result(dir)
        real(wp), intent(in) :: ra                          !! right ascension (hours)
        real(wp), intent(in) :: dec                         !! declination (degrees)
        real(wp) :: dir(3)
        real(wp) :: a, d
        a = ra / 24.0_wp * 2.0_wp * pi
        d = dec * pi / 180.0_wp
        dir = [cos(a) * cos(d), sin(a) * cos(d), sin(d)]
    end function sky_direction