Instrument Neutral Distributed Interface INDI  2.0.0
TelescopeDirectionVectorSupportFunctions.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "Common.h"
12 #include "libastro.h"
13 #include "indicom.h"
14 
15 namespace INDI
16 {
17 namespace AlignmentSubsystem
18 {
25 {
26  public:
29 
41  typedef enum AzimuthAngleDirection
42  {
46 
55  typedef enum PolarAngleDirection
56  {
60 
69  INDI::IHorizontalCoordinates &HorizontalCoordinates)
70  {
71  double AzimuthAngle;
72  double AltitudeAngle;
74  AltitudeAngle, FROM_AZIMUTHAL_PLANE);
75  HorizontalCoordinates.azimuth = range360(RAD_TO_DEG(AzimuthAngle));
76  HorizontalCoordinates.altitude = RAD_TO_DEG(AltitudeAngle);
77  };
78 
86  INDI::IEquatorialCoordinates &EquatorialCoordinates)
87  {
88  double AzimuthAngle;
89  double PolarAngle;
91  PolarAngle, FROM_AZIMUTHAL_PLANE);
92  EquatorialCoordinates.rightascension = range24(RAD_TO_DEG(AzimuthAngle) / 15.0);
93  EquatorialCoordinates.declination = rangeDec(RAD_TO_DEG(PolarAngle));
94  };
95 
103  INDI::IEquatorialCoordinates &EquatorialCoordinates)
104  {
105  double AzimuthAngle;
106  double PolarAngle;
109  EquatorialCoordinates.rightascension = range24(RAD_TO_DEG(AzimuthAngle) / 15.0);
110  EquatorialCoordinates.declination = rangeDec(RAD_TO_DEG(PolarAngle));
111  };
112 
122  double &AzimuthAngle,
124  double &PolarAngle, PolarAngleDirection_t PolarAngleDirection);
125 
133  HorizontalCoordinates)
134  {
136  DEG_TO_RAD(HorizontalCoordinates.altitude),
138  };
139 
147  {
150  DEG_TO_RAD(EquatorialCoordinates.declination),
152  };
153 
161  {
163  DEG_TO_RAD(EquatorialCoordinates.declination),
165  };
166 
176  TelescopeDirectionVectorFromSphericalCoordinate(const double AzimuthAngle,
178  const double PolarAngle, PolarAngleDirection_t PolarAngleDirection);
179 };
180 
181 } // namespace AlignmentSubsystem
182 } // namespace INDI
These functions are used to convert different coordinate systems to and from the telescope direction ...
const TelescopeDirectionVector TelescopeDirectionVectorFromSphericalCoordinate(const double AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, const double PolarAngle, PolarAngleDirection_t PolarAngleDirection)
Calculates a telescope direction vector from the supplied spherical coordinate information.
void SphericalCoordinateFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, double &AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, double &PolarAngle, PolarAngleDirection_t PolarAngleDirection)
Calculates a spherical coordinate from the supplied telescope direction vector.
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth(INDI::IHorizontalCoordinates HorizontalCoordinates)
Calculates a normalised direction vector from the supplied altitude and azimuth.
void EquatorialCoordinatesFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
Calculates equatorial coordinates from the supplied telescope direction vector and declination.
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates(INDI::IEquatorialCoordinates EquatorialCoordinates)
Calculates a telescope direction vector from the supplied equatorial coordinates.
const TelescopeDirectionVector TelescopeDirectionVectorFromLocalHourAngleDeclination(INDI::IEquatorialCoordinates EquatorialCoordinates)
Calculates a telescope direction vector from the supplied local hour angle and declination.
void LocalHourAngleDeclinationFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
Calculates a local hour angle and declination from the supplied telescope direction vector and declin...
enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection PolarAngleDirection_t
void AltitudeAzimuthFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IHorizontalCoordinates &HorizontalCoordinates)
Calculates an altitude and azimuth from the supplied normalised direction vector and declination.
enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AzimuthAngleDirection AzimuthAngleDirection_t
double range24(double r)
range24 Limits a number to be between 0-24 range.
Definition: indicom.c:1235
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
Definition: indicom.c:1245
double rangeDec(double decdegrees)
rangeDec Limits declination value to be in -90 to 90 range.
Definition: indicom.c:1255
Implementations for common driver routines.
#define DEG_TO_RAD(deg)
Definition: libastro.h:37
#define RAD_TO_DEG(rad)
Definition: libastro.h:36
Namespace to encapsulate INDI client, drivers, and mediator classes.
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:69