Instrument Neutral Distributed Interface INDI  2.0.2
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
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.
The Vector class This implements the Directional Cosine used by Taki in his Matrix method....
Namespace to encapsulate INDI client, drivers, and mediator classes.
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:69