Instrument Neutral Distributed Interface INDI  2.0.2
BasicMathPlugin.h
Go to the documentation of this file.
1 
9 #pragma once
10 
12 #include "ConvexHull.h"
13 
14 #include <gsl/gsl_matrix.h>
15 
16 namespace INDI
17 {
18 namespace AlignmentSubsystem
19 {
24 {
25  public:
28 
30  virtual ~BasicMathPlugin();
31 
34 
36  virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination,
37  double JulianOffset,
38  TelescopeDirectionVector &ApparentTelescopeDirectionVector);
39 
41  virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector,
42  double &RightAscension, double &Declination);
43 
44  protected:
54  virtual void
56  const TelescopeDirectionVector &Alpha3, const TelescopeDirectionVector &Beta1,
57  const TelescopeDirectionVector &Beta2, const TelescopeDirectionVector &Beta3,
58  gsl_matrix *pAlphaToBeta, gsl_matrix *pBetaToAlpha) = 0;
59 
63  void Dump3(const char *Label, gsl_vector *pVector);
64 
68  void Dump3x3(const char *Label, gsl_matrix *pMatrix);
69 
73  double Matrix3x3Determinant(gsl_matrix *pMatrix);
74 
79  bool MatrixInvert3x3(gsl_matrix *pInput, gsl_matrix *pInversion);
80 
82  void MatrixMatrixMultiply(gsl_matrix *pA, gsl_matrix *pB, gsl_matrix *pC);
83 
85  void MatrixVectorMultiply(gsl_matrix *pA, gsl_vector *pB, gsl_vector *pC);
86 
95  TelescopeDirectionVector &TriangleVertex2, TelescopeDirectionVector &TriangleVertex3);
96 
97  // Transformation matrixes for 1, 2 and 3 sync points case
100 
101  // Convex hulls for 4+ sync points case
104  // Actual direction cosines for the 4+ case
105  std::vector<TelescopeDirectionVector> ActualDirectionCosines;
106 };
107 
108 } // namespace AlignmentSubsystem
109 } // namespace INDI
This class encapsulates all the alignment subsystem classes that are useful to math plugin implementa...
This class implements the common functionality for the built in and SVD math plugins.
bool MatrixInvert3x3(gsl_matrix *pInput, gsl_matrix *pInversion)
Calculate the inverse of the supplied matrix.
double Matrix3x3Determinant(gsl_matrix *pMatrix)
Caluclate the determinant of the supplied matrix.
void MatrixMatrixMultiply(gsl_matrix *pA, gsl_matrix *pB, gsl_matrix *pC)
Multiply matrix A by matrix B and put the result in C.
void Dump3(const char *Label, gsl_vector *pVector)
Print out a 3 vector to debug.
virtual void CalculateTransformMatrices(const TelescopeDirectionVector &Alpha1, const TelescopeDirectionVector &Alpha2, const TelescopeDirectionVector &Alpha3, const TelescopeDirectionVector &Beta1, const TelescopeDirectionVector &Beta2, const TelescopeDirectionVector &Beta3, gsl_matrix *pAlphaToBeta, gsl_matrix *pBetaToAlpha)=0
Calculate tranformation matrices from the supplied vectors.
std::vector< TelescopeDirectionVector > ActualDirectionCosines
virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination)
Override for the base class virtual function.
void MatrixVectorMultiply(gsl_matrix *pA, gsl_vector *pB, gsl_vector *pC)
Multiply matrix A by vector B and put the result in vector C.
virtual ~BasicMathPlugin()
Virtual destructor.
bool RayTriangleIntersection(TelescopeDirectionVector &Ray, TelescopeDirectionVector &TriangleVertex1, TelescopeDirectionVector &TriangleVertex2, TelescopeDirectionVector &TriangleVertex3)
Test if a ray intersects a triangle in 3d space.
virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
Override for the base class virtual function.
virtual bool Initialise(InMemoryDatabase *pInMemoryDatabase)
Override for the base class virtual function.
void Dump3x3(const char *Label, gsl_matrix *pMatrix)
Print out a 3x3 matrix to debug.
This class computes the convex hull of a set of 3d points.
Definition: ConvexHull.h:60
This class provides the driver side API to the in memory alignment database.
InMemoryDatabase * pInMemoryDatabase
Definition: MathPlugin.h:83
Namespace to encapsulate INDI client, drivers, and mediator classes.
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:69