Sun position
Sun position algorithm
|
64 #define UNUSED_EPOCH_cy (-99.9)
65 #define HALFPI_PLUS_SFA (HALFPI + SFA)
66 #define TROP_YEAR (TROP_CENT / 100.0)
67 #define STRINGEMPTY (-2)
72 LOCAL int extractObjectName(
const char coordStr[],
76 LOCAL int parseEpochStr(
const char epochStr[],
80 LOCAL double myStrtod(
const char str[],
const char **endPtr,
int *error);
83 #ifdef PREDEF_STANDARD_C_1999
85 static inline char *saferStrncpy(
char *dest,
const char *src,
size_t len)
91 strncat(dest, src, len - 1);
99 #define saferStrncpy(dest__, src__, len__) \
100 ( (dest__)[0] = '\0', \
101 ((len__) > 0) ? strncat((dest__), (src__), (len__) - 1) : (dest__) )
114 LOCAL const double lightTime_s = 499.0047863852;
115 LOCAL const double au_km = 1.49597871464e8;
118 LOCAL const double invC_dpau = lightTime_s / 86400.0;
119 LOCAL const double auFactor = 86400.0 / au_km;
218 appV->a[0] = appV->a[1] = appV->a[2] = 0.0;
249 star_earth(j2kTT_cy, &npM, &ebV_au, &ebdotV_aupd, &sbV_au);
257 p0V.a[0] = (qV.a[0] + tau * mV_radpcy.a[0]);
258 p0V.a[1] = (qV.a[1] + tau * mV_radpcy.a[1]);
259 p0V.a[2] = (qV.a[2] + tau * mV_radpcy.a[2]);
270 printVector(
"Eb", &ebV_au);
271 printVector(
"Eb'", &ebdotV_aupd);
272 printVector(
"Sb", &sbV_au);
273 printMatrix(
"NP", &npM);
274 printVector(
"q", &qV);
275 printVector(
"m", &mV_radpcy);
276 printf(
"tau = %.9f\n", tau);
277 printVector(
"p0", &p0V);
278 printVector(
"P", &pV);
287 #ifdef RUN_RIDICULOUSLY_RIGOROUS_RELATIVISTIC_ROUTINE
288 star_lightDeflection(&pV, &ebV_au, &ebdotV_aupd, &sbV_au, &p2V);
297 printVector(
"p", &pV);
298 printVector(
"p2", &p2V);
419 double sinRa, cosRa, sinDec, cosDec;
429 pV->a[0] = cosRa * cosDec;
430 pV->a[1] = sinRa * cosDec;
534 static const double g1_rad = 0.9856003 *
DEG2RAD;
535 static const double l1_rad = 0.9856474 *
DEG2RAD;
536 static const double lam1_rad = 1.915 *
DEG2RAD;
537 static const double lam2_rad = 0.020 *
DEG2RAD;
538 static const double r1 = 0.01671;
539 static const double r2 = 0.00014;
566 sincos(g_rad, &sing, &cosg);
567 sincos(g_rad + g_rad, &sin2g, &cos2g);
569 lambda_rad = L_rad + lam1_rad * sing + lam2_rad * sin2g;
570 epsilon_rad =
degToRad(23.439 - (0.0000004 * n));
571 r_au = 1.00014 - r1 * cosg - r2 * cos2g;
575 posV.a[0] = -r_au * cos(lambda_rad);
576 posV.a[1] = -r_au * cos(epsilon_rad) * sin(lambda_rad);
577 posV.a[2] = -r_au * sin(epsilon_rad) * sin(lambda_rad);
582 lambdadot = l1_rad + lam1_rad * g1_rad * cosg
583 + 2.0 * lam2_rad * g1_rad * cos2g;
584 rdot = -r1 * g1_rad * sing - 2.0 * r2 * sin2g;
586 velV.a[0] = r_au * sin(lambda_rad) * lambdadot - cos(lambda_rad) * rdot;
587 velV.a[1] = -cos(epsilon_rad) * (r_au * cos(lambda_rad) * lambdadot
588 + sin(lambda_rad) * rdot);
589 velV.a[2] = -sin(epsilon_rad) * (r_au * cos(lambda_rad) * lambdadot
590 + sin(lambda_rad) * rdot);
622 aberrV.a[0] = earthVelV_aupd->a[0] * invC_dpau;
623 aberrV.a[1] = earthVelV_aupd->a[1] * invC_dpau;
624 aberrV.a[2] = earthVelV_aupd->a[2] * invC_dpau;
655 REQUIRE(eqnxStrSize < INT_MAX);
657 switch (coordBlock->
cSys) {
659 saferStrncpy(equinoxStr,
"Apparent", eqnxStrSize);
663 saferStrncpy(equinoxStr,
"Intermediate", eqnxStrSize);
672 snprintf(equinoxStr, eqnxStrSize,
"B%05d ", epoch_ax10);
673 if (eqnxStrSize > 7) { equinoxStr[6] = equinoxStr[5]; }
674 if (eqnxStrSize > 6) { equinoxStr[5] =
'.'; }
679 epoch_ax10 = (int)(coordBlock->
eqnxT_cy * 1000.0 + 20000.5);
680 snprintf(equinoxStr, eqnxStrSize,
"J%05d ", epoch_ax10);
681 if (eqnxStrSize > 7) { equinoxStr[6] = equinoxStr[5]; }
682 if (eqnxStrSize > 6) { equinoxStr[5] =
'.'; }
686 saferStrncpy(equinoxStr,
"ICRS", eqnxStrSize);
690 equinoxStr[0] =
'\0';
722 REQUIRE(epochStrSize < INT_MAX);
729 switch (coordBlock->
cSys) {
739 * 10.0 / TROP_YEAR) + 19000.5);
740 snprintf(epochStr, epochStrSize,
"B%05d ", epoch_ax10);
741 if (epochStrSize > 7) { epochStr[6] = epochStr[5]; }
742 if (epochStrSize > 6) { epochStr[5] =
'.'; }
748 epoch_ax10 = (int)(epochT_cy * 1000.0 + 20000.5);
749 snprintf(epochStr, epochStrSize,
"J%05d ", epoch_ax10);
750 if (epochStrSize > 7) { epochStr[6] = epochStr[5]; }
751 if (epochStrSize > 6) { epochStr[5] =
'.'; }
769 double muRaSplat_maspa,
771 double annParallax_as,
812 coordBlock->
cSys = coordSys;
813 switch (coordBlock->
cSys) {
816 coordBlock->
eqnxT_cy = UNUSED_EPOCH_cy;
820 coordBlock->
eqnxT_cy = ((equinoxYear - 1900.0) * TROP_YEAR
822 coordBlock->
epochT_cy = ((epochYear - 1900.0) * TROP_YEAR
826 coordBlock->
eqnxT_cy = (equinoxYear - 2000.0) / 100.0;
827 coordBlock->
epochT_cy = (epochYear - 2000.0) / 100.0;
831 coordBlock->
epochT_cy = (epochYear - 2000.0) / 100.0;
849 if (fabs(coordBlock->
dec_rad) > HALFPI_PLUS_SFA) {
853 && ((equinoxYear < 0.0) || (equinoxYear > 9999.9)))
859 && ((equinoxYear < 0.0) || (equinoxYear > 9999.9)))
876 double annParallax_as,
916 coordBlock->
cSys = coordSys;
917 switch (coordBlock->
cSys) {
920 coordBlock->
eqnxT_cy = UNUSED_EPOCH_cy;
924 coordBlock->
eqnxT_cy = ((equinoxYear - 1900.0) * TROP_YEAR
926 coordBlock->
epochT_cy = ((epochYear - 1900.0) * TROP_YEAR
930 coordBlock->
eqnxT_cy = (equinoxYear - 2000.0) / 100.0;
931 coordBlock->
epochT_cy = (epochYear - 2000.0) / 100.0;
935 coordBlock->
epochT_cy = (epochYear - 2000.0) / 100.0;
953 if (fabs(coordBlock->
dec_rad) > HALFPI_PLUS_SFA) {
957 && ((equinoxYear < 0.0) || (equinoxYear > 9999.9)))
963 && ((equinoxYear < 0.0) || (equinoxYear > 9999.9)))
1068 const char *startPtr;
1070 bool muRAsupplied =
false;
1071 bool muDecSupplied =
false;
1072 bool piSupplied =
false;
1080 memset(coordBlock, 0,
sizeof(*coordBlock));
1081 coordBlock->
eqnxT_cy = UNUSED_EPOCH_cy;
1082 coordBlock->
epochT_cy = UNUSED_EPOCH_cy;
1087 decodeError = extractObjectName(startPtr,
1095 if (*endPtr ==
',') { endPtr++; }
1100 if (decodeError == 0) {
1103 }
else if (decodeError == INVALID_ANGLE) {
1115 if (decodeError == 0) {
1118 }
else if (decodeError == INVALID_ANGLE) {
1123 if (fabs(coordBlock->
dec_rad) > HALFPI_PLUS_SFA) {
1129 decodeError = parseEpochStr(startPtr,
1133 if (decodeError == STRINGEMPTY) {
1135 coordBlock->
eqnxT_cy = UNUSED_EPOCH_cy;
1136 coordBlock->
epochT_cy = UNUSED_EPOCH_cy;
1138 }
else if (decodeError != 0) {
1148 if (*endPtr ==
',') { endPtr++; }
1153 decodeError = parseEpochStr(startPtr,
1157 if (decodeError == STRINGEMPTY) {
1161 }
else if (decodeError != 0) {
1169 if (*endPtr ==
',') { endPtr++; }
1171 if (startPtr[0] !=
'\0') {
1172 tempVal = myStrtod(startPtr, &endPtr, &decodeError);
1173 if (decodeError == STRINGEMPTY) {
1175 }
else if (decodeError != 0) {
1181 muRAsupplied =
true;
1184 if (*endPtr ==
',') { endPtr++; }
1186 tempVal = myStrtod(startPtr, &endPtr, &decodeError);
1187 if (decodeError == STRINGEMPTY) {
1189 }
else if (decodeError != 0) {
1194 muDecSupplied =
true;
1196 if (muRAsupplied && !muDecSupplied) {
1199 if (muDecSupplied && !muRAsupplied) {
1208 if (*endPtr ==
',') { endPtr++; }
1210 if (startPtr[0] !=
'\0') {
1211 tempVal = myStrtod(startPtr, &endPtr, &decodeError);
1212 if (decodeError == STRINGEMPTY) {
1214 }
else if (decodeError != 0) {
1221 if (piSupplied && !muRAsupplied && !muDecSupplied) {
1230 if (*endPtr ==
',') { endPtr++; }
1232 if (startPtr[0] !=
'\0') {
1233 tempVal = myStrtod(startPtr, &endPtr, &decodeError);
1234 if (decodeError == STRINGEMPTY) {
1236 }
else if (decodeError != 0) {
1242 if (muRAsupplied && muDecSupplied && piSupplied) {
1292 double invbeta, p1vbeta;
1303 scale = 1.0 / eMag_au;
1304 eV.a[0] = e0V_au.a[0] * scale;
1305 eV.a[1] = e0V_au.a[1] * scale;
1306 eV.a[2] = e0V_au.a[2] * scale;
1310 dpV.a[0] = (2.0 * 9.87e-9 / eMag_au) * (eV.a[0] - ep * pV->a[0]) / (1 + ep);
1311 dpV.a[1] = (2.0 * 9.87e-9 / eMag_au) * (eV.a[1] - ep * pV->a[1]) / (1 + ep);
1312 dpV.a[2] = (2.0 * 9.87e-9 / eMag_au) * (eV.a[2] - ep * pV->a[2]) / (1 + ep);
1314 p1V.a[0] = pV->a[0] + dpV.a[0];
1315 p1V.a[1] = pV->a[1] + dpV.a[1];
1316 p1V.a[2] = pV->a[2] + dpV.a[2];
1318 printVector(
"E", &e0V_au);
1319 printf(
"|E| = %.9f\n", eMag_au);
1320 printVector(
"e", &eV);
1321 printf(
"e.p = %.9f\n", ep);
1322 printVector(
"dp", &dpV);
1323 printVector(
"p1", &p1V);
1326 vV.a[0] = invC_dpau * earthVelV_aupd->a[0];
1327 vV.a[1] = invC_dpau * earthVelV_aupd->a[1];
1328 vV.a[2] = invC_dpau * earthVelV_aupd->a[2];
1330 invbeta = sqrt(1 - vMag * vMag);
1332 p1vbeta = 1.0 + p1dotV / (1.0 + invbeta);
1334 printVector(
"V", &vV);
1335 printf(
"|V| = %.9f\n", vMag);
1336 printf(
"invbeta = %.9f\n", invbeta);
1337 printf(
"p1.V = %.9f\n", p1dotV);
1338 printf(
"1 + (p1.V)/(1 + invbeta) = %.9f\n", p1vbeta);
1340 p2V->a[0] = (invbeta * p1V.a[0] + p1vbeta * vV.a[0]) / (1.0 + p1dotV);
1341 p2V->a[1] = (invbeta * p1V.a[1] + p1vbeta * vV.a[1]) / (1.0 + p1dotV);
1342 p2V->a[2] = (invbeta * p1V.a[2] + p1vbeta * vV.a[2]) / (1.0 + p1dotV);
1355 LOCAL int extractObjectName(
const char coordStr[],
1358 const char **endPtr)
1371 const char *sc, *ec;
1374 if (coordStr[0] ==
'"') {
1376 ec = strchr(sc,
'"');
1379 if (*endPtr != NULL) { (*endPtr)++; }
1381 ec = strchr(coordStr,
',');
1388 n = (size_t)(ec - sc) + 1;
1389 if (n > nameStrSize) {
1392 saferStrncpy(nameStr, sc, n);
1399 LOCAL int parseEpochStr(
const char epochStr[],
1402 const char **endPtr)
1445 static const char *apparent =
"APPARENT";
1446 static const char *intermediate =
"INTERMEDIATE";
1447 static const char *icrs =
"ICRS";
1458 while (isspace(epochStr[i])) {
1461 while( (j <
sizeof(upEpStr) - 1) && (epochStr[i] !=
'\0')
1462 && !isspace(epochStr[i]) && (epochStr[i] !=
','))
1464 upEpStr[j] = (char)toupper(epochStr[i]);
1469 if (endPtr != NULL) {
1470 *endPtr = &epochStr[i];
1474 if (upEpStr[0] ==
'\0') {
1475 *epochT_cy = UNUSED_EPOCH_cy;
1481 if ((j >= 3) && (strstr(apparent, upEpStr) == apparent)) {
1483 *epochT_cy = UNUSED_EPOCH_cy;
1485 }
else if ((j >= 3) && (strstr(intermediate, upEpStr) == intermediate)) {
1487 *epochT_cy = UNUSED_EPOCH_cy;
1489 }
else if ((j >= 3) && (strstr(icrs, upEpStr) == icrs)) {
1495 if (upEpStr[0] ==
'B') {
1497 tempEpoch = myStrtod(&epochStr[i - j + 1], NULL, &sError);
1499 }
else if (upEpStr[0] ==
'J') {
1501 tempEpoch = myStrtod(&epochStr[i - j + 1], NULL, &sError);
1503 }
else if ((epochStr[i - j] >=
'0') && (epochStr[i - j] <=
'9')) {
1504 tempEpoch = myStrtod(&epochStr[0], NULL, &sError);
1505 if (tempEpoch < 1984.0) {
1512 sError = STRINGEMPTY;
1516 if ((sError != 0) || (tempEpoch < 0.0) || (tempEpoch > 9999.9)) {
1520 if (*coordSys ==
FK4) {
1521 *epochT_cy = ((tempEpoch - 1900.0) * TROP_YEAR
1523 }
else if (*coordSys ==
FK5) {
1524 *epochT_cy = (tempEpoch - 2000.0) / 100.0;
1535 LOCAL double myStrtod(
const char str[],
const char **endPtr,
int *error)
1564 num = strtod(str, &endPtr2);
1565 if (endPtr2 == str) {
1566 status = STRINGEMPTY;
1572 if (endPtr != NULL) { *endPtr = endPtr2; }
1573 if (error != NULL) { *error = status; }
sky1.h - astronomical coordinate conversion routines, IAU 1980
double muDec_radpcy
μδ - Proper motion in Dec (radian/Julian century)
void star_catalogToVectors(const Star_CatalogPosn *c, V3D_Vector *pV, V3D_Vector *vV_radpcy)
This routine takes the mean equatorial polar coordinate of an object and its proper motions,...
V3D_Matrix * v3d_multMxM(V3D_Matrix *destM, const V3D_Matrix *srcM1, const V3D_Matrix *srcM2)
Multiply 3x3 matrix by 3x3 matrix to give a new 3x3 matrix, as per [destM] = [srcM1]*[srcM2].
general.h - definitions of general use to (standard) C programs
@ STAR_ERRINMUDEC
Proper motion in Declination can't be decoded.
V3D_Vector appCirsV
Direction of object in apparent or CIRS coordinates (effectively a unit vector).
This structure contains relatively constant data, and is set up by one of the three functions sky_ini...
skyio.h - output and formatting routines and a read routine
V3D_Vector * v3d_polarToRect(V3D_Vector *destV, double alpha_rad, double delta_rad)
Converts polar (curvilinear) coordinates to equivalent rectangular (Cartesian) coordinates.
#define REQUIRE(test_)
Check preconditions.
void sky_siteTirsToTopo(const V3D_Vector *terInterV, double dist_au, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Transform a coordinate vector from the Terrestrial Intermediate Reference System to topocentric Az/El...
Nutation angles and obliquity.
double v3d_magV(const V3D_Vector *srcV)
Return the magnitude of the specified vector.
astron.h - assorted definitions useful for astronomy
@ STAR_ERRINDEC
Declination can't be decoded.
@ STAR_ERRINMURA
Proper motion in RA can't be decoded.
Star_CoordSys
Coordinate system equator and origin.
int star_setCatalogPosn(const char objectName[], double ra_h, double dec_deg, Star_CoordSys coordSys, double equinoxYear, double epochYear, double muRaSplat_maspa, double muDec_maspa, double annParallax_as, double radVel_kmps, Star_CatalogPosn *coordBlock)
This is one of three alternative routines for loading the information for a celestial object into a b...
void sky_updateTimes(double j2kUtc_d, const Sky_DeltaTs *d, Sky_Times *t)
Convert the given "J2KD" in the UTC timescale to the other timescales, and pre-calculate some other q...
void sky1_epsilon1980(double t_cy, Sky1_Nut1980 *nut)
Calculate the obliquity of the ecliptic and the equation of the equinoxes.
bool epochSpecified
equinox and epoch were separately specified
#define MJD_J2000
MJD of Fundamental Epoch J2000.0.
Struct used for holding an object's coordinates in equatorial apparent or Intermediate coordinates.
@ STAR_NORA
Specification of Right Ascension is missing.
@ STAR_NOMURA
Specification of proper motion in RA is missing when mu_dec was provided.
@ STAR_ERRINRA
Right Ascension can't be decoded.
#define LOCAL
C has some very silly default behaviours.
double j2kTT_cy
Julian centuries since J2000.0, TT timescale [T].
double skyio_sxStrToAng(const char angleStr[], const char **endPtr, int *error)
Convert a string containing an angle (or a time) in sexagesimal format to the angle's value.
#define REQUIRE_NOT_NULL(pointer_)
,
double ra_rad
α - Right Ascension (radian)
#define SFA
A very small number, used to avoid divide by 0 errors.
double parallax_rad
π - annual parallax (radian)
This structure contains the continuously varying time (and earth rotation) data, in various forms tha...
@ STAR_DECRANERR
Declination out of range.
char * star_epochToStr(const Star_CatalogPosn *coordBlock, char epochStr[], size_t epochStrSize)
Write the epoch used for proper motion calculations out in a standard form.
#define RAD2ARCSEC
radians to arcseconds
double eqEq_rad
Equation of the Equinoxes (radian).
V3D_Vector * v3d_multMtransxV(V3D_Vector *destV, const V3D_Matrix *srcM, const V3D_Vector *srcV)
Multiply 3x1 vector by the transpose of the 3x3 matrix to give a new 3x1 vector, as per equation [des...
static double secToRad(double angle_s)
Returns angle_s converted from seconds to radians.
void star_getTopocentric(double j2kUtc_d, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Calls star_getApparent() to calculate the star's position in apparent coordinates,...
void sky1_frameBiasFK5(V3D_Matrix *biasM)
Create the frame bias matrix from the IAU 2000 precession-nutation model.
void star_annAberr(const V3D_Vector *p1V, const V3D_Vector *earthVelV_aupd, V3D_Vector *p2V)
Apply the annual aberration correction, to convert an object's coordinates from geocentric geometric ...
bool muRaInclCosDec
μα term already includes the cosδ factor.
char objectName[80]
Name of the celestial object (optional)
#define MJD_B1900
MJD of Besselian std epoch B1900.0.
Star_CoordSys cSys
equator and origin used for α & δ
@ APPARENT
True equator and equinox of date.
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...
#define DEG2RAD
degrees to radians
@ ICRS
International Celestial Reference System.
double timestamp_cy
Time applying to the other figures in this struct (centuries since J2000.0, TT timescale)
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...
void star_getApparent(double j2kTT_cy, Sky_TrueEquatorial *pos)
Calculate the position of the currently selected star (or other object outside the solar system) as a...
void star_earth(double t1_cy, const V3D_Matrix *npM, V3D_Vector *ebV_au, V3D_Vector *ebdotV_aupd, V3D_Vector *sbV_au)
Calculate the position and velocity of the Earth, for use in making annual parallax and aberration co...
@ STAR_ERRINVR
Radial Velocity can't be decoded.
static double arcsecToRad(double angle_as)
Returns angle_as converted from arcseconds to radians.
double muRA_radpcy
μα - Proper motion in RA (radian/Julian century)
double distance_au
Distance to object (Astronomical Units) or 0.0 for far distant objects (that is, those with negligibl...
instead-of-math.h - header to be included instead of math.h
V3D_Vector * v3d_subtractV(V3D_Vector *destV, const V3D_Vector *srcV1, const V3D_Vector *srcV2)
Vector subtraction: [destV] = [srcV1] - [srcV2].
double v3d_dotProductV(const V3D_Vector *srcV1, const V3D_Vector *srcV2)
Return the dot product of the two vectors: res = [srcV1] · [srcV2] or res = ||srcV1|| * ||srcV2|| * c...
static double degToRad(double angle_deg)
Returns angle_deg converted from degrees to radians.
double epochT_cy
time zero for proper motion (Julian centuries since J2000, TT timescale)
@ FK4
Mean equator and equinox of Besselian epoch.
int star_setCatalogOldStyle(const char objectName[], double ra_h, double dec_deg, Star_CoordSys coordSys, double equinoxYear, double epochYear, double muRa_spcy, double muDec_aspcy, double annParallax_as, double radVel_kmps, Star_CatalogPosn *coordBlock)
This is one of three alternative routines for loading the information for a celestial object into a b...
int star_parseCoordString(const char inStr[], Star_CatalogPosn *coordBlock)
This is one of three alternative routines for loading the information for a celestial object into a b...
void sky1_precessionIAU1976(double t0, double t1, Sky1_Prec1976 *terms)
This procedure calculates the equatorial precession parameters ζ, z, and θ which represent the rotati...
#define DEFINE_THIS_FILE
Leave DEFINE_THIS_FILE undefined.
star.h - Astronomical conversion routines for stars and other objects beyond the Solar System
@ FK5
Mean equator and equinox of Julian epoch.
@ INTERMEDIATE
True equator and CIO of date.
sky.h - structures and routines for astronomical observing & tracking
@ STAR_NOMUDEC
Specification of proper motion in Dec is missing when mu_ra was provided.
#define JUL_CENT
Length of Julian Century in days.
vectors3d.h - Three dimensional geometry, vectors and matrices
@ STAR_ERRINPARAL
Parallax can't be decoded.
void sky1_createPrec1976Matrix(const Sky1_Prec1976 *terms, V3D_Matrix *precM)
This routine calculates the precession matrix, based on angles ζ, z, and θ.
double j2kUT1_d
days since J2000.0, UT1 timescale [Du]
double eqEq_rad
Equation of the Equinoxes (radian)
@ STAR_ERRINOBJ
Error extracting object name from the string.
Catalogue position of a celestial object.
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.
V3D_Vector * v3d_addToUVfast(V3D_Vector *modV1, const V3D_Vector *srcV2)
Modify a unit length rectangular position vector modV1 by adding a small correction vector srcV2 to i...
static double hrsToRad(double angle_h)
Returns angle_h converted from hours to radians.
static void sincos(double angle_rad, double *sinA, double *cosA)
Calculates sine and cosine of an angle.
@ STAR_RARANERR
Right Ascension out of range.
void star_catalogToApp(const Star_CatalogPosn *c, double j2kTT_cy, const Sky1_Nut1980 *nut, V3D_Vector *appV, double *dist_au)
Convert the catalogue coordinates for a star (or other object outside the Solar System) to apparent c...
void star_setCurrentObject(const Star_CatalogPosn *c)
Copies the catalogue information in c to internal storage for later use by star_getApparent()
@ STAR_PINEEDSPM
Proper motion must be specified if specifying parallax.
@ STAR_VRNEEDSPM
Proper motion and parallax must be specified if specifying Radial Velocity.
double radVel_aupcy
ν - radial velocity (AU/Julian century)
V3D_Vector * v3d_multMxV(V3D_Vector *destV, const V3D_Matrix *srcM, const V3D_Vector *srcV)
Multiply 3x3 matrix by 3x1 vector to give a new 3x1 vector, as per equation [destV] = [srcM] * [srcV]...
double dec_rad
δ - Declination (radian)
@ STAR_NORMAL
Normal successful completion.
@ STAR_NODEC
Specification of Declination is missing.
static double normalize(double x, double range)
Normalizes a cyclic double precision floating point variable x to the interval [0,...
@ STAR_IVEPOCH
Invalid epoch or equinox specification.
Coordinates of a celestial object in the horizon frame, in both rectangular and polar forms.
char * star_equinoxToStr(const Star_CatalogPosn *coordBlock, char equinoxStr[], size_t eqnxStrSize)
Write the coordinate system and equinox out in a standard form.
double eqnxT_cy
time of equinox for FK4 or FK5 positions (Julian centuries since J2000, TT timescale)