38 #include <libnova/precession.h>
39 #include <libnova/aberration.h>
40 #include <libnova/transform.h>
41 #include <libnova/nutation.h>
56 ln_get_equ_aber(&libnova_observed, jd, &tempPos);
58 tempPos.ra = libnova_observed.ra - (tempPos.ra - libnova_observed.ra);
59 tempPos.dec = libnova_observed.dec * 2 - tempPos.dec;
64 struct ln_equ_posn libnova_J2000Pos;
66 ln_get_equ_prec2(&tempPos, jd, JD2000, &libnova_J2000Pos);
86 ln_get_equ_prec2(&libnova_J2000Pos, JD2000, jd, &tempPosn);
91 struct ln_equ_posn libnova_observed;
93 ln_get_equ_aber(&tempPosn, jd, &libnova_observed);
106 struct ln_nutation nut;
107 ln_get_nutation (jd, &nut);
109 double mean_ra, mean_dec, delta_ra, delta_dec;
116 double nut_ecliptic =
DEG_TO_RAD(nut.ecliptic + nut.obliquity);
117 double sin_ecliptic = sin(nut_ecliptic);
119 double sin_ra = sin(mean_ra);
120 double cos_ra = cos(mean_ra);
122 double tan_dec = tan(mean_dec);
124 delta_ra = (cos (nut_ecliptic) + sin_ecliptic * sin_ra * tan_dec) * nut.longitude - cos_ra * tan_dec * nut.obliquity;
125 delta_dec = (sin_ecliptic * cos_ra) * nut.longitude + sin_ra * nut.obliquity;
130 delta_ra = -delta_ra;
131 delta_dec = -delta_dec;
133 posn->ra += delta_ra;
134 posn->dec += delta_dec;
146 struct ln_equ_posn libnova_object = {
object->rightascension * 15.0,
object->declination};
147 struct ln_hrz_posn horizontalPos;
148 ln_get_hrz_from_equ(&libnova_object, &libnova_location, JD, &horizontalPos);
150 position->
altitude = horizontalPos.alt;
162 struct ln_hrz_posn libnova_object = {
range360(object->azimuth + 180),
object->altitude};
163 struct ln_equ_posn equatorialPos;
164 ln_get_equ_from_hrz(&libnova_object, &libnova_location, JD, &equatorialPos);
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
Implementations for common driver routines.
Namespace to encapsulate INDI client, drivers, and mediator classes.
void ln_get_equ_nut(ln_equ_posn *posn, double jd, bool reverse)
apply or remove nutation
void J2000toObserved(IEquatorialCoordinates *J2000pos, double jd, IEquatorialCoordinates *observed)
*J2000toObserved converts catalogue to observed
void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD, IHorizontalCoordinates *position)
EquatorialToHorizontal Calculate horizontal coordinates from equatorial coordinates.
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.
void ObservedToJ2000(IEquatorialCoordinates *observed, double jd, IEquatorialCoordinates *J2000pos)
ObservedToJ2000 converts an observed position to a J2000 catalogue position removes aberration,...