Instrument Neutral Distributed Interface INDI  1.9.5
TelescopeDirectionVectorSupportFunctions.cpp
Go to the documentation of this file.
1 
10 
11 namespace INDI
12 {
13 namespace AlignmentSubsystem
14 {
16  const TelescopeDirectionVector TelescopeDirectionVector, double &AzimuthAngle,
18 {
20  {
22  {
24  PolarAngle = asin(TelescopeDirectionVector.z);
25  }
26  else
27  {
29  PolarAngle = acos(TelescopeDirectionVector.z);
30  }
31  }
32  else
33  {
35  {
36  AzimuthAngle = atan2(-TelescopeDirectionVector.y, TelescopeDirectionVector.x);
37  PolarAngle = asin(TelescopeDirectionVector.z);
38  }
39  else
40  {
41  AzimuthAngle = atan2(-TelescopeDirectionVector.y, TelescopeDirectionVector.x);
42  PolarAngle = acos(TelescopeDirectionVector.z);
43  }
44  }
45 }
46 
49  const double AzimuthAngle, AzimuthAngleDirection AzimuthAngleDirection, const double PolarAngle,
51 {
53 
55  {
57  {
58  Vector.x = cos(PolarAngle) * cos(AzimuthAngle);
59  Vector.y = cos(PolarAngle) * sin(AzimuthAngle);
60  Vector.z = sin(PolarAngle);
61  }
62  else
63  {
64  Vector.x = sin(PolarAngle) * sin(AzimuthAngle);
65  Vector.y = sin(PolarAngle) * cos(AzimuthAngle);
66  Vector.z = cos(PolarAngle);
67  }
68  }
69  else
70  {
72  {
73  Vector.x = cos(PolarAngle) * cos(-AzimuthAngle);
74  Vector.y = cos(PolarAngle) * sin(-AzimuthAngle);
75  Vector.z = sin(PolarAngle);
76  }
77  else
78  {
79  Vector.x = sin(PolarAngle) * sin(-AzimuthAngle);
80  Vector.y = sin(PolarAngle) * cos(-AzimuthAngle);
81  Vector.z = cos(PolarAngle);
82  }
83  }
84 
85  return Vector;
86 }
87 
88 } // namespace AlignmentSubsystem
89 } // namespace INDI
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::AzimuthAngleDirection
AzimuthAngleDirection
Definition: TelescopeDirectionVectorSupportFunctions.h:41
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::ANTI_CLOCKWISE
@ ANTI_CLOCKWISE
Definition: TelescopeDirectionVectorSupportFunctions.h:44
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection
PolarAngleDirection
Definition: TelescopeDirectionVectorSupportFunctions.h:55
INDI::AlignmentSubsystem::TelescopeDirectionVector::z
double z
Definition: Common.h:78
INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::FROM_AZIMUTHAL_PLANE
@ FROM_AZIMUTHAL_PLANE
Definition: TelescopeDirectionVectorSupportFunctions.h:58
INDI::AlignmentSubsystem::TelescopeDirectionVector::y
double y
Definition: Common.h:77
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
TelescopeDirectionVectorSupportFunctions.h
Vector
The Vector class This implements the Directional Cosine used by Taki in his Matrix method....
Definition: scopesim_helper.h:503
INDI::AlignmentSubsystem::TelescopeDirectionVector::x
double x
Definition: Common.h:76
INDI::AlignmentSubsystem::TelescopeDirectionVector
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:68