Sun position
Sun position algorithm
sky1.h
Go to the documentation of this file.
1 #ifndef SKY1_H
2 #define SKY1_H
3 /*============================================================================*/
4 /*!\file
5  * \brief sky1.h - astronomical coordinate conversion routines, IAU 1980
6  *
7  * \author David Hoadley
8  *
9  * \details
10  * This is one of three alternative modules: sky0.h / sky0.c,
11  * sky1.h / sky1.c and sky2.h / sky2.c. They contain routines for
12  * transforming astronomical positions from frame to another:
13  * precession, nutation, sidereal time etc. and they reflect changes
14  * in the International Astronomical Union's precession and nutation
15  * theory.
16  * The differences are:
17  * - sky0.h / sky0.c: nutation, obliquity and sidereal time routines
18  * from the NREL Solar Position Algorithm document. These are based
19  * on the IAU 1980 nutation theory.
20  * - sky1.h / sky1.c: precession, nutation and their associated
21  * rotation matrices, obliquity and sidereal time. These are the
22  * IAU 1980 precession and nutation theory.
23  * - sky2.h / sky2.c: precession, nutation and their associated
24  * rotation matrices, obliquity and sidereal time. These are the
25  * newer IAU 2000 precession and nutation theory.
26  *
27  * This module (sky1.h / sky1.c) contains precession and nutation
28  * routines. The precession routine uses the IAU 1976 algorithm.
29  * The nutation routine uses the IAU 1980 algorithm.
30  *
31  *==============================================================================
32  */
33 /*
34  * Copyright (c) 2020, David Hoadley <vcrumble@westnet.com.au>
35  * All rights reserved.
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions are met:
39  *
40  * * Redistributions of source code must retain the above copyright notice, this
41  * list of conditions and the following disclaimer.
42  * * Redistributions in binary form must reproduce the above copyright notice,
43  * this list of conditions and the following disclaimer in the documentation
44  * and/or other materials provided with the distribution.
45  *
46  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
47  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
50  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
52  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
53  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
55  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
56  * POSSIBILITY OF SUCH DAMAGE.
57  */
58 /*------------------------------------------------------------------------------
59  * Notes:
60  * Character set: UTF-8. (Non-ASCII characters appear in this file)
61  *----------------------------------------------------------------------------*/
62 #include "vectors3d.h"
63 
64 /*
65  * Global #defines and typedefs
66  */
67 /*! Precession angles.*/
68 typedef struct {
69  double zeta_rad; //!< Precession angle (ζ) (radian)
70  double zed_rad; //!< Precession angle (z) (radian)
71  double theta_rad; //!< Precession angle (θ) (radian)
73 
74 /*! Nutation angles and obliquity */
75 typedef struct {
76  double dPsi_rad; //!< Nutation in longitude (Δψ) (radian)
77  double dEps_rad; //!< Nutation in obliquity (Δε) (radian)
78  double eps0_rad; //!< Mean obliquity of ecliptic at date (ε0)(radian)
79  double eqEq_rad; //!< Equation of the Equinoxes (radian)
80 } Sky1_Nut1980;
81 
82 
83 /*
84  * Global functions available to be called by other modules
85  */
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
90 void sky1_frameBiasFK5(V3D_Matrix *biasM);
91 
92 void sky1_precessionIAU1976(double t0, double t1, Sky1_Prec1976 *terms);
93 void sky1_createPrec1976Matrix(const Sky1_Prec1976 *terms, V3D_Matrix *precM);
94 
95 void sky1_nutationIAU1980(double t_cy, int precision, Sky1_Nut1980 *nut);
96 void sky1_epsilon1980(double t_cy, Sky1_Nut1980 *nut);
97 void sky1_createNut1980Matrix(const Sky1_Nut1980 *nut, V3D_Matrix *nutM);
98 
99 void sky1_createNPmatrix(double t0_cy,
100  double t1_cy,
101  int precision,
102  V3D_Matrix* npM);
103 
104 double sky1_gmSiderealTimeIAU1982(double du);
105 void sky1_appToTirs(const V3D_Vector *appV,
106  double j2kUT1_d,
107  double eqEq_rad,
108  V3D_Vector *terInterV);
109 
110 /*
111  * Global variables accessible by other modules
112  */
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif /* SKY1_H */
Sky1_Nut1980
Nutation angles and obliquity.
Definition: sky1.h:75
sky1_epsilon1980
void sky1_epsilon1980(double t_cy, Sky1_Nut1980 *nut)
Calculate the obliquity of the ecliptic and the equation of the equinoxes.
Definition: sky1.c:631
Sky1_Prec1976::zed_rad
double zed_rad
Precession angle (z) (radian)
Definition: sky1.h:70
sky1_createNPmatrix
void sky1_createNPmatrix(double t0_cy, double t1_cy, int precision, V3D_Matrix *npM)
Call the various precession and nutation routines in this module to create a combined precession and ...
Definition: sky1.c:721
Sky1_Nut1980::dPsi_rad
double dPsi_rad
Nutation in longitude (Δψ) (radian)
Definition: sky1.h:76
sky1_frameBiasFK5
void sky1_frameBiasFK5(V3D_Matrix *biasM)
Create the frame bias matrix from the IAU 2000 precession-nutation model.
Definition: sky1.c:339
Sky1_Nut1980::dEps_rad
double dEps_rad
Nutation in obliquity (Δε) (radian)
Definition: sky1.h:77
sky1_createNut1980Matrix
void sky1_createNut1980Matrix(const Sky1_Nut1980 *nut, V3D_Matrix *nutM)
This routine calculates the Nutation matrix, using the nutation in longitude, the nutation in obliqui...
Definition: sky1.c:676
sky1_appToTirs
void sky1_appToTirs(const V3D_Vector *appV, double j2kUT1_d, double eqEq_rad, V3D_Vector *terInterV)
Convert a position in geocentric apparent coordinates to geocentric coordinates in the Terrestrial In...
Definition: sky1.c:810
V3D_Matrix
3x3 matrix.
Definition: vectors3d.h:51
V3D_Vector
3x1 vector.
Definition: vectors3d.h:57
sky1_gmSiderealTimeIAU1982
double sky1_gmSiderealTimeIAU1982(double du)
Calculate the Greenwich mean sidereal time.
Definition: sky1.c:766
sky1_precessionIAU1976
void sky1_precessionIAU1976(double t0, double t1, Sky1_Prec1976 *terms)
This procedure calculates the equatorial precession parameters ζ, z, and θ which represent the rotati...
Definition: sky1.c:375
Sky1_Nut1980::eps0_rad
double eps0_rad
Mean obliquity of ecliptic at date (ε0)(radian)
Definition: sky1.h:78
Sky1_Prec1976::theta_rad
double theta_rad
Precession angle (θ) (radian)
Definition: sky1.h:71
vectors3d.h
vectors3d.h - Three dimensional geometry, vectors and matrices
sky1_createPrec1976Matrix
void sky1_createPrec1976Matrix(const Sky1_Prec1976 *terms, V3D_Matrix *precM)
This routine calculates the precession matrix, based on angles ζ, z, and θ.
Definition: sky1.c:437
Sky1_Nut1980::eqEq_rad
double eqEq_rad
Equation of the Equinoxes (radian)
Definition: sky1.h:79
sky1_nutationIAU1980
void sky1_nutationIAU1980(double t_cy, int precision, Sky1_Nut1980 *nut)
Calculates the nutation in longitude and obliquity, according to the IAU 1980 Nutation Theory.
Definition: sky1.c:481
Sky1_Prec1976
Precession angles.
Definition: sky1.h:68
Sky1_Prec1976::zeta_rad
double zeta_rad
Precession angle (ζ) (radian)
Definition: sky1.h:69