Sun position
Sun position algorithm
planet.h
Go to the documentation of this file.
1 #ifndef PLANET_H
2 #define PLANET_H
3 /*============================================================================*/
4 /*! \file
5  * \brief planet.h - Astronomical routines to get the positions of planets
6  *
7  * \author David Hoadley, based on a routine from the IAU's SOFA collection
8  *
9  * \details
10  * Routines to obtain a specified planet's position and convert that
11  * position to apparent coordinates and/or topocentric coordinates.
12  *
13  *==============================================================================
14  */
15 /*
16  *
17  *
18  * Copyright (c) 2020, David Hoadley <vcrumble@westnet.com.au>
19  * All rights reserved.
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions are met:
23  *
24  * * Redistributions of source code must retain the above copyright notice, this
25  * list of conditions and the following disclaimer.
26  * * Redistributions in binary form must reproduce the above copyright notice,
27  * this list of conditions and the following disclaimer in the documentation
28  * and/or other materials provided with the distribution.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
34  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40  * POSSIBILITY OF SUCH DAMAGE.
41  *
42  *==============================================================================
43  */
44 #include "sky.h"
45 #include "sky1.h"
46 #include "vectors3d.h"
47 
48 /*
49  * Global #defines and typedefs
50  */
51 
52 
53 /*
54  * Global functions available to be called by other modules
55  */
56 void planet_setCurrent(int np);
57 
58 void planet_getApp2(double t_cy,
59  int np,
60  const Sky1_Nut1980 *nut,
61  V3D_Vector *appV,
62  double *dist_au);
63 void planet_getApparent(double j2kTT_cy, Sky_TrueEquatorial *pos);
64 void planet_getTopocentric(double j2kUtc_d,
65  const Sky_DeltaTs *deltas,
66  const Sky_SiteProp *site,
67  Sky_SiteHorizon *topo);
68 
69 void planet_getGeocentric(double t_cy,
70  int np,
71  V3D_Vector *p2V,
72  double *dist_au);
73 
74 int planet_getHeliocentric(double t_cy,
75  int np,
76  V3D_Vector *j2kV_au,
77  V3D_Vector *velV_aupd);
78 
79 /*
80  * Global variables accessible by other modules
81  */
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* PLANET_H */
93 
sky1.h
sky1.h - astronomical coordinate conversion routines, IAU 1980
planet_getApparent
void planet_getApparent(double j2kTT_cy, Sky_TrueEquatorial *pos)
Calculate the position of the currently selected planet as a unit vector and a distance,...
Definition: planet.c:154
Sky_DeltaTs
This structure contains relatively constant data, and is set up by one of the three functions sky_ini...
Definition: sky.h:166
planet_getApp2
void planet_getApp2(double t_cy, int np, const Sky1_Nut1980 *nut, V3D_Vector *appV, double *dist_au)
This function calculates the specified planet's position in apparent coordinates, using the planet_ge...
Definition: planet.c:105
Sky1_Nut1980
Nutation angles and obliquity.
Definition: sky1.h:75
planet_getTopocentric
void planet_getTopocentric(double j2kUtc_d, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Calls planet_getApparent() to calculate the planet's position in apparent coordinates,...
Definition: planet.c:195
Sky_TrueEquatorial
Struct used for holding an object's coordinates in equatorial apparent or Intermediate coordinates.
Definition: sky.h:106
planet_getHeliocentric
int planet_getHeliocentric(double t_cy, int np, V3D_Vector *j2kV_au, V3D_Vector *velV_aupd)
Calculates an approximate heliocentric position of the selected planet.
Definition: planet.c:344
Sky_SiteProp
Site properties.
Definition: sky.h:315
planet_getGeocentric
void planet_getGeocentric(double t_cy, int np, V3D_Vector *p2V, double *dist_au)
Calculates an approximate position of the selected planet as seen from the centre of the earth.
Definition: planet.c:242
planet_setCurrent
void planet_setCurrent(int np)
Stores the selected planet number np in internal storage for later use by planet_getApparent() or pla...
Definition: planet.c:89
V3D_Vector
3x1 vector.
Definition: vectors3d.h:57
sky.h
sky.h - structures and routines for astronomical observing & tracking
vectors3d.h
vectors3d.h - Three dimensional geometry, vectors and matrices
Sky_SiteHorizon
Coordinates of a celestial object in the horizon frame, in both rectangular and polar forms.
Definition: sky.h:129