Skip to content
Snippets Groups Projects
Commit 8962239d authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Added IsMatrixOrthogonal()

parent 8ed22e46
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,10 @@ namespace math
/// Transform the orientation by the transform.
static Eigen::Matrix3f TransformOrientation(const Eigen::Matrix4f& transform, const Eigen::Matrix3f& ori);
/// Indicates whether the matrix is orthogonal, i.e. matrix * matrix.transpose = identity.
template <typename Derived>
static bool IsMatrixOrthogonal(const Eigen::MatrixBase<Derived>& matrix, float precision = 1e-6f);
static float Distance(const Eigen::Matrix4f& a, const Eigen::Matrix4f& b, float rad2mmFactor);
static Eigen::VectorXf LimitVectorLength(const Eigen::VectorXf& vec, const Eigen::VectorXf& maxLen);
......@@ -210,6 +214,11 @@ namespace math
return inv;
}
template<typename Derived>
bool Helpers::IsMatrixOrthogonal(const Eigen::MatrixBase<Derived>& matrix, float precision)
{
return (matrix * matrix.transpose()).isIdentity(precision);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment