62 static double range(
double deg)
64 while (deg > 180.0) deg -= 360.0;
65 while (deg <= -180.0) deg += 360.0;
69 static double hrstoDeg(
double hrs)
71 return range(hrs * 15.0);
86 angle = range(degrees);
106 return (angle >= 0) ? angle : 360.0 + angle;
115 double h = angle / 15.0;
151 angle = hrstoDeg(hrs);
167 return range(this->angle - a.angle);
172 return Angle(-this->angle);
177 angle = range(angle + a.angle);
183 angle = range(angle + d);
189 angle = range(angle - a.angle);
195 angle = range(angle - d);
201 return Angle(this->angle + a.angle);
206 return Angle(this->angle + d);
211 return Angle(this->angle - rhs.angle);
216 return Angle(this->angle - rhs);
228 return Angle(this->angle * duration);
331 void StartGuide(
double rate, uint32_t durationMs);
335 return guideDuration > 0;
351 struct timeval lastTime
356 bool tracking =
false;
360 Angle rotateCentre { 90.0 };
362 double guideDuration = 0;
363 Angle guideRateDegSec;
446 setCorrections(coeffs[0], coeffs[1], coeffs[2], coeffs[3], coeffs[4], coeffs[5]);
525 Angle flipHourAngle = 0;
544 void correction(
Angle instrumentHa,
Angle instrumentDec,
Angle *correctionHa,
Angle *correctionDec);
616 return L *
L +
M *
M +
N *
N;
The Alignment class This converts between the mount axis angles and the sky hour angle and declinatio...
void setCorrections(double ih, double id, double ch, double np, double ma, double me)
setCorrections set the values of the six corrections
void instrumentHaDecToMount(Angle instrumentHa, Angle instrumentDec, Angle *primary, Angle *secondary)
void apparentRaDecToMount(Angle apparentRa, Angle apparentDec, Angle *primary, Angle *secondary)
void mountToApparentHaDec(Angle primary, Angle secondary, Angle *apparentHa, Angle *apparentDec)
mountToApparentHaDec: convert mount position to apparent Ha, Dec
const char * getDeviceName()
void apparentHaDecToMount(Angle apparentHa, Angle apparentDec, Angle *primary, Angle *secondary)
apparentHaDecToMount
void observedToInstrument(Angle observedHa, Angle observedDec, Angle *instrumentHa, Angle *instrumentDec)
void mountToApparentRaDec(Angle primary, Angle secondary, Angle *apparentRa, Angle *apparentDec)
mountToApparentRaDec: convert mount position to apparent Ra, Dec
void instrumentToObserved(Angle instrumentHa, Angle instrumentDec, Angle *observedHa, Angle *observedDec)
void setFlipHourAngle(double deg)
void setCorrections(double *coeffs)
void mountToInstrumentHaDec(Angle primary, Angle secondary, Angle *instrumentHa, Angle *instrumentDec)
mountToInstrumentHaDec: convert mount axis positions to instrument (encoder) HA/Dec without applying ...
The Angle class This class implements an angle type. This holds an angle that is always in the range ...
double Degrees360()
Degrees360.
bool operator<=(const Angle &a)
double difference(Angle a)
bool operator==(const Angle &a)
void setHours(double hrs)
setHours set the angle
Angle & operator+=(const Angle &a)
void setDegrees(double deg)
setDegrees set the angle in degrees
bool operator>(const Angle &a)
bool operator!=(const Angle &a)
Angle & operator-=(const Angle &a)
bool operator>=(const Angle &a)
bool operator<(const Angle &a)
Angle operator*(const double duration)
operator * multiplies the angle by a double, used to manage tracking and slewing
Angle operator+(const Angle &a)
The Axis class Implements a generic Axis which can be used for equatorial or AltAz mounts for both ax...
Angle TrackingRateDegSec
TrackingRateDegSec.
void setDegrees(double degrees)
const char * getDeviceName()
void StartGuide(double rate, uint32_t durationMs)
StartGuide start guiding.
void Tracking(bool enabled)
AXIS_TRACK_RATE TrackRate()
TrackRate returns the AXIS_TRACK_RATE property.
void StartSlew(Angle angle)
double getTrackingRateDegSec()
AXIS_TRACK_RATE
The AXIS_TRACK_RATE enum defines the common track rates.
void setHours(double hours)
The Vector class This implements the Directional Cosine used by Taki in his Matrix method....
Vector rotateY(Angle angle)
rotateY rotates this vector through angle about the Y axis
Vector rotateX(Angle angle)
rotateX rotates this vector through angle about the X axis
Vector()
Vector creates an empty vector.
Vector rotateZ(Angle angle)
rotateZ rotates this vector through angle about the Z axis
Angle secondary()
secondary returns the secondary angle (dec, altitude) from this vector
Angle primary()
primary returns the primary angle (Ra, Ha, Azimuth) from this vector
Implementations for common driver routines.
#define TRACKRATE_SIDEREAL
char device_str[64]
The transformations are based on the paper "Matrix Method for Coordinates Transformation" written by ...