Instrument Neutral Distributed Interface INDI  1.9.5
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
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::EquatorialCoordinatesFromTelescopeDirectionVector
void EquatorialCoordinatesFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
Calculates equatorial coordinates from the supplied telescope direction vector and declination.
Definition: TelescopeDirectionVectorSupportFunctions.h:85
INDI::IHorizontalCoordinates::azimuth
double azimuth
Definition: libastro.h:58
INDI::IEquatorialCoordinates::declination
double declination
Definition: libastro.h:51
indicom.h
Implementations for common driver routines.
DEG_TO_RAD
#define DEG_TO_RAD(deg)
Definition: libastro.h:37
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::TelescopeDirectionVectorFromSphericalCoordinate
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.
Definition: TelescopeDirectionVectorSupportFunctions.cpp:48
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::SphericalCoordinateFromTelescopeDirectionVector
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.
Definition: TelescopeDirectionVectorSupportFunctions.cpp:15
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AltitudeAzimuthFromTelescopeDirectionVector
void AltitudeAzimuthFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IHorizontalCoordinates &HorizontalCoordinates)
Calculates an altitude and azimuth from the supplied normalised direction vector and declination.
Definition: TelescopeDirectionVectorSupportFunctions.h:68
range24
double range24(double r)
range24 Limits a number to be between 0-24 range.
Definition: indicom.c:1485
RAD_TO_DEG
#define RAD_TO_DEG(rad)
Definition: libastro.h:36
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AzimuthAngleDirection
AzimuthAngleDirection
Definition: TelescopeDirectionVectorSupportFunctions.h:41
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::ANTI_CLOCKWISE
@ ANTI_CLOCKWISE
Definition: TelescopeDirectionVectorSupportFunctions.h:44
range360
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
Definition: indicom.c:1495
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::FROM_POLAR_AXIS
@ FROM_POLAR_AXIS
Definition: TelescopeDirectionVectorSupportFunctions.h:57
INDI::IEquatorialCoordinates::rightascension
double rightascension
Definition: libastro.h:50
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection_t
enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection PolarAngleDirection_t
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection
PolarAngleDirection
Definition: TelescopeDirectionVectorSupportFunctions.h:55
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::TelescopeDirectionVectorFromLocalHourAngleDeclination
const TelescopeDirectionVector TelescopeDirectionVectorFromLocalHourAngleDeclination(INDI::IEquatorialCoordinates EquatorialCoordinates)
Calculates a telescope direction vector from the supplied local hour angle and declination.
Definition: TelescopeDirectionVectorSupportFunctions.h:160
INDI::IHorizontalCoordinates::altitude
double altitude
Definition: libastro.h:59
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::CLOCKWISE
@ CLOCKWISE
Definition: TelescopeDirectionVectorSupportFunctions.h:43
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::FROM_AZIMUTHAL_PLANE
@ FROM_AZIMUTHAL_PLANE
Definition: TelescopeDirectionVectorSupportFunctions.h:58
Common.h
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::LocalHourAngleDeclinationFromTelescopeDirectionVector
void LocalHourAngleDeclinationFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
Calculates a local hour angle and declination from the supplied telescope direction vector and declin...
Definition: TelescopeDirectionVectorSupportFunctions.h:102
rangeDec
double rangeDec(double decdegrees)
rangeDec Limits declination value to be in -90 to 90 range.
Definition: indicom.c:1505
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AzimuthAngleDirection_t
enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AzimuthAngleDirection AzimuthAngleDirection_t
INDI::IHorizontalCoordinates
Definition: libastro.h:56
INDI::IEquatorialCoordinates
Definition: libastro.h:48
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::TelescopeDirectionVectorFromEquatorialCoordinates
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates(INDI::IEquatorialCoordinates EquatorialCoordinates)
Calculates a telescope direction vector from the supplied equatorial coordinates.
Definition: TelescopeDirectionVectorSupportFunctions.h:146
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::~TelescopeDirectionVectorSupportFunctions
virtual ~TelescopeDirectionVectorSupportFunctions()
Virtual destructor.
Definition: TelescopeDirectionVectorSupportFunctions.h:28
INDI::AlignmentSubsystem::TelescopeDirectionVector
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:68
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions
These functions are used to convert different coordinate systems to and from the telescope direction ...
Definition: TelescopeDirectionVectorSupportFunctions.h:24
libastro.h
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::TelescopeDirectionVectorFromAltitudeAzimuth
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth(INDI::IHorizontalCoordinates HorizontalCoordinates)
Calculates a normalised direction vector from the supplied altitude and azimuth.
Definition: TelescopeDirectionVectorSupportFunctions.h:132