Instrument Neutral Distributed Interface INDI  1.9.2
libastro.h
Go to the documentation of this file.
1 /*
2  libastro
3 
4  functions used for coordinate conversions, based on libnova
5 
6  Copyright (C) 2020 Chris Rowland
7  Copyright (C) 2021 Jasem Mutlaq
8 
9  This library is free software; you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published
11  by the Free Software Foundation; either version 2.1 of the License, or
12  (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with this library; if not, write to the Free Software Foundation,
21  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 */
24 
25 // file libsatro.h
26 
27 // functions used for coordinate conversions, based on libnova
28 
29 #pragma once
30 
31 #include <libnova/utility.h>
32 
33 namespace INDI
34 {
35 
36 #define RAD_TO_DEG(rad) (rad * 180.0/M_PI)
37 #define DEG_TO_RAD(deg) (deg * M_PI/180.0)
38 
45 
48 typedef struct
49 {
50  double rightascension;
51  double declination;
53 
56 typedef struct
57 {
58  double azimuth;
59  double altitude;
61 
64 typedef struct
65 {
66  double longitude;
67  double latitude;
68  double elevation;
70 
73 /*
74 * \brief This provides astrometric helper functions
75 * based on the libnova library
76 */
77 
85 void ObservedToJ2000(IEquatorialCoordinates *observed, double jd, IEquatorialCoordinates *J2000pos);
86 
94 void J2000toObserved(IEquatorialCoordinates *J2000pos, double jd, IEquatorialCoordinates * observed);
95 
104 void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD,
105  IHorizontalCoordinates *position);
106 
115 void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD,
116  IEquatorialCoordinates *position);
117 
124 void ln_get_equ_nut(ln_equ_posn *posn, double jd, bool reverse = false);
125 
126 }
INDI::IHorizontalCoordinates::azimuth
double azimuth
Definition: libastro.h:58
INDI::IEquatorialCoordinates::declination
double declination
Definition: libastro.h:51
INDI::IGeographicCoordinates::elevation
double elevation
Definition: libastro.h:68
INDI::ObservedToJ2000
void ObservedToJ2000(IEquatorialCoordinates *observed, double jd, IEquatorialCoordinates *J2000pos)
ObservedToJ2000 converts an observed position to a J2000 catalogue position removes aberration,...
Definition: libastro.cpp:50
INDI::IEquatorialCoordinates::rightascension
double rightascension
Definition: libastro.h:50
INDI::IGeographicCoordinates::longitude
double longitude
Definition: libastro.h:66
INDI::IGeographicCoordinates::latitude
double latitude
Definition: libastro.h:67
INDI::EquatorialToHorizontal
void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD, IHorizontalCoordinates *position)
EquatorialToHorizontal Calculate horizontal coordinates from equatorial coordinates.
Definition: libastro.cpp:140
INDI::IHorizontalCoordinates::altitude
double altitude
Definition: libastro.h:59
INDI::IGeographicCoordinates
Definition: libastro.h:64
INDI::HorizontalToEquatorial
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.
Definition: libastro.cpp:156
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::IHorizontalCoordinates
Definition: libastro.h:56
INDI::IEquatorialCoordinates
Definition: libastro.h:48
INDI::J2000toObserved
void J2000toObserved(IEquatorialCoordinates *J2000pos, double jd, IEquatorialCoordinates *observed)
*J2000toObserved converts catalogue to observed
Definition: libastro.cpp:80
INDI::ln_get_equ_nut
void ln_get_equ_nut(ln_equ_posn *posn, double jd, bool reverse)
apply or remove nutation
Definition: libastro.cpp:102