Class MEAL::UnitTangent

class UnitTangent : public MEAL::Evaluable<Vector<3, double>>

Represents a unit vector in three-dimensional space.

This model of a unit vector solves the gimbal lock issue by redefining the basis as it moves. At any point, the coordinates of the vector are defined by (0,0). A step in the any of the two possible directions is defined as a step in the plane that is tangent to the unit sphere.

After such a step, when the evaluate method is called, the vector is renormalized, the unit vectors in the tangent plane are redefined, and the coordinates are reset to (0,0).

When choosing the new unit vectors in the tangent plane, the direction to the most distant axis (in Cartesian coordinates) is used to define the first direction.

Note that, in this representation, it is impossible to rotate the unit vector by more than 90 degrees in one step. This should also provide some stability during modelling.

Public Functions

virtual std::string get_name() const

Return the name of the class.

void set_vector(Vector<3, double> direction)

Set the direction of the unit vector.

void set_vector(const Vector<3, Estimate<double>> &direction)

Set the direction of the unit vector with error.

inline Vector<3, double> get_basis(unsigned i)

Get the basis vector.