Instrument Neutral Distributed Interface INDI  1.9.5
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
AlignmentSubsystemForMathPlugins.h
INDI::AlignmentSubsystem::BasicMathPlugin::Dump3
void Dump3(const char *Label, gsl_vector *pVector)
Print out a 3 vector to debug.
Definition: BasicMathPlugin.cpp:817
INDI::AlignmentSubsystem::AlignmentSubsystemForMathPlugins
This class encapsulates all the alignment subsystem classes that are useful to math plugin implementa...
Definition: AlignmentSubsystemForMathPlugins.h:16
INDI::AlignmentSubsystem::BasicMathPlugin::RayTriangleIntersection
bool RayTriangleIntersection(TelescopeDirectionVector &Ray, TelescopeDirectionVector &TriangleVertex1, TelescopeDirectionVector &TriangleVertex2, TelescopeDirectionVector &TriangleVertex3)
Test if a ray intersects a triangle in 3d space.
Definition: BasicMathPlugin.cpp:900
INDI::AlignmentSubsystem::BasicMathPlugin::ActualConvexHull
ConvexHull ActualConvexHull
Definition: BasicMathPlugin.h:102
INDI::AlignmentSubsystem::BasicMathPlugin::BasicMathPlugin
BasicMathPlugin()
Default constructor.
Definition: BasicMathPlugin.cpp:25
INDI::AlignmentSubsystem::BasicMathPlugin::pApparentToActualTransform
gsl_matrix * pApparentToActualTransform
Definition: BasicMathPlugin.h:99
INDI::AlignmentSubsystem::BasicMathPlugin::TransformCelestialToTelescope
virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
Override for the base class virtual function.
Definition: BasicMathPlugin.cpp:361
INDI::AlignmentSubsystem::BasicMathPlugin::TransformTelescopeToCelestial
virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination)
Override for the base class virtual function.
Definition: BasicMathPlugin.cpp:589
INDI::AlignmentSubsystem::BasicMathPlugin::CalculateTransformMatrices
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.
INDI::AlignmentSubsystem::BasicMathPlugin::~BasicMathPlugin
virtual ~BasicMathPlugin()
Virtual destructor.
Definition: BasicMathPlugin.cpp:33
INDI::AlignmentSubsystem::BasicMathPlugin::Matrix3x3Determinant
double Matrix3x3Determinant(gsl_matrix *pMatrix)
Caluclate the determinant of the supplied matrix.
Definition: BasicMathPlugin.cpp:835
INDI::AlignmentSubsystem::BasicMathPlugin::ApparentConvexHull
ConvexHull ApparentConvexHull
Definition: BasicMathPlugin.h:103
INDI::AlignmentSubsystem::BasicMathPlugin::Initialise
virtual bool Initialise(InMemoryDatabase *pInMemoryDatabase)
Override for the base class virtual function.
Definition: BasicMathPlugin.cpp:41
INDI::AlignmentSubsystem::InMemoryDatabase
This class provides the driver side API to the in memory alignment database.
Definition: InMemoryDatabase.h:23
INDI::AlignmentSubsystem::MathPlugin::pInMemoryDatabase
InMemoryDatabase * pInMemoryDatabase
Definition: MathPlugin.h:80
INDI::AlignmentSubsystem::BasicMathPlugin::Dump3x3
void Dump3x3(const char *Label, gsl_matrix *pMatrix)
Print out a 3x3 matrix to debug.
Definition: BasicMathPlugin.cpp:823
INDI::AlignmentSubsystem::BasicMathPlugin::MatrixInvert3x3
bool MatrixInvert3x3(gsl_matrix *pInput, gsl_matrix *pInversion)
Calculate the inverse of the supplied matrix.
Definition: BasicMathPlugin.cpp:855
INDI::AlignmentSubsystem::BasicMathPlugin::MatrixVectorMultiply
void MatrixVectorMultiply(gsl_matrix *pA, gsl_vector *pB, gsl_vector *pC)
Multiply matrix A by vector B and put the result in vector C.
Definition: BasicMathPlugin.cpp:892
INDI::AlignmentSubsystem::BasicMathPlugin::pActualToApparentTransform
gsl_matrix * pActualToApparentTransform
Definition: BasicMathPlugin.h:98
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
INDI::AlignmentSubsystem::BasicMathPlugin::ActualDirectionCosines
std::vector< TelescopeDirectionVector > ActualDirectionCosines
Definition: BasicMathPlugin.h:105
INDI::AlignmentSubsystem::BasicMathPlugin::MatrixMatrixMultiply
void MatrixMatrixMultiply(gsl_matrix *pA, gsl_matrix *pB, gsl_matrix *pC)
Multiply matrix A by matrix B and put the result in C.
Definition: BasicMathPlugin.cpp:882
INDI::AlignmentSubsystem::ConvexHull
This class computes the convex hull of a set of 3d points.
Definition: ConvexHull.h:59
INDI::AlignmentSubsystem::BasicMathPlugin
This class implements the common functionality for the built in and SVD math plugins.
Definition: BasicMathPlugin.h:23
ConvexHull.h
INDI::AlignmentSubsystem::TelescopeDirectionVector
Holds a nomalised direction vector (direction cosines)
Definition: Common.h:68