49 #define ALGORITHMSANGLE_C 55 #include <OpenMesh/Core/Geometry/MathDefs.hh> 74 template <
typename VectorT ,
typename ValueT >
79 _vector1 = _vector1 - _normal * ( _vector1 | _normal );
80 _vector2 = _vector2 - _normal * ( _vector2 | _normal );
85 const double right = ( ( _normal % _vector1 ) | _vector2 ) ;
87 double sp = ( _vector1 | _vector2 );
98 double angle = acos(sp);
104 angle = 2 * M_PI - angle;
110 template <
typename ValueT >
113 angleDist(
const ValueT& angle0 ,
const ValueT& angle1 ) {
114 ValueT dist = fabs( angle1 - angle0 );
115 return ( std::min( dist , 2 * M_PI - dist) );
118 template <
typename ValueT >
127 if ( angle_asin >= 0 ) {
128 if ( angle_acos >= 0 ) {
131 return (M_PI - angle_asin);
134 if ( angle_acos >= 0 ) {
135 return (2 * M_PI + angle_asin);
137 return (M_PI - angle_asin);
142 template <
typename ValueT >
146 return ( _angle / M_PI * 180);
149 template <
typename ValueT >
153 return ( _angle / 180 * M_PI );
ValueT degToRad(const ValueT &_angle)
ValueT angleDist(const ValueT &angle0, const ValueT &angle1)
Namespace providing different geometric functions concerning angles.
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Functions for geometric operations related to angles.
ValueT radToDeg(const ValueT &_angle)
ValueT getFullangle(VectorT _vector1, VectorT _vector2, const VectorT &_normal, bool &_skip)
bool isNan(double x)
Return false if x is not a number.
ValueT getAngle(const ValueT &_cos, const ValueT &_sin)
auto normalize() -> decltype(*this/=std::declval< VectorT< S, DIM >>().norm())