Instrument Neutral Distributed Interface INDI 2.2.5
BasicMathPlugin.h
Go to the documentation of this file.
1
8
9#pragma once
10
12#include "ConvexHull.h"
13
14#include <gsl/gsl_matrix.h>
15
16namespace INDI
17{
18namespace AlignmentSubsystem
19{
24{
25 public:
28
30 virtual ~BasicMathPlugin();
31
33 virtual bool Initialise(InMemoryDatabase *pInMemoryDatabase) override;
34
36 virtual bool TransformCelestialToTelescopeJD(double RightAscension, double Declination,
37 double JulianDate,
38 TelescopeDirectionVector &ApparentTelescopeDirectionVector) override;
39
41 virtual bool TransformTelescopeToCelestialJD(const TelescopeDirectionVector &ApparentTelescopeDirectionVector,
42 double &RightAscension, double &Declination, double JulianDate) override;
43
45 virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination,
46 double JulianOffset,
47 TelescopeDirectionVector &ApparentTelescopeDirectionVector) override;
48
50 virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector,
51 double &RightAscension, double &Declination, double JulianOffset = 0) override;
52
53 protected:
63 virtual void
65 const TelescopeDirectionVector &Alpha3, const TelescopeDirectionVector &Beta1,
66 const TelescopeDirectionVector &Beta2, const TelescopeDirectionVector &Beta3,
67 gsl_matrix *pAlphaToBeta, gsl_matrix *pBetaToAlpha) = 0;
68
72 void Dump3(const char *Label, gsl_vector *pVector);
73
77 void Dump3x3(const char *Label, gsl_matrix *pMatrix);
78
82 double Matrix3x3Determinant(gsl_matrix *pMatrix);
83
88 bool MatrixInvert3x3(gsl_matrix *pInput, gsl_matrix *pInversion);
89
91 void MatrixMatrixMultiply(gsl_matrix *pA, gsl_matrix *pB, gsl_matrix *pC);
92
94 void MatrixVectorMultiply(gsl_matrix *pA, gsl_vector *pB, gsl_vector *pC);
95
104 TelescopeDirectionVector &TriangleVertex2, TelescopeDirectionVector &TriangleVertex3);
105
106 // Transformation matrixes for 1, 2 and 3 sync points case
109
110 // Convex hulls for 4+ sync points case
113 // Actual direction cosines for the 4+ case
114 std::vector<TelescopeDirectionVector> ActualDirectionCosines;
115};
116
117} // namespace AlignmentSubsystem
118} // 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)
Calculate 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.
virtual bool TransformTelescopeToCelestialJD(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianDate) override
Override for the base class virtual function.
void Dump3(const char *Label, gsl_vector *pVector)
Print out a 3 vector to debug.
virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianOffset=0) override
Compat shim - resolves JD and delegates to TransformTelescopeToCelestialJD.
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 transformation matrices from the supplied vectors.
std::vector< TelescopeDirectionVector > ActualDirectionCosines
virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector) override
Compat shim - resolves JD and delegates to TransformCelestialToTelescopeJD.
virtual bool TransformCelestialToTelescopeJD(double RightAscension, double Declination, double JulianDate, TelescopeDirectionVector &ApparentTelescopeDirectionVector) override
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 Initialise(InMemoryDatabase *pInMemoryDatabase) override
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.
Namespace to encapsulate INDI client, drivers, and mediator classes.
Holds a normalised direction vector (direction cosines)
Definition Common.h:69