59 #define ALGORITHMSANGLE_C
65 #include <OpenMesh/Core/Geometry/MathDefs.hh>
84 template <
typename VectorT ,
typename ValueT >
89 _vector1 = _vector1 - _normal * ( _vector1 | _normal );
90 _vector2 = _vector2 - _normal * ( _vector2 | _normal );
95 const double right = ( ( _normal % _vector1 ) | _vector2 ) ;
97 double sp = ( _vector1 | _vector2 );
108 double angle = acos(sp);
114 angle = 2 * M_PI - angle;
120 template <
typename ValueT >
123 angleDist(
const ValueT& angle0 ,
const ValueT& angle1 ) {
124 ValueT dist = fabs( angle1 - angle0 );
125 return ( std::min( dist , 2 * M_PI - dist) );
128 template <
typename ValueT >
137 if ( angle_asin >= 0 ) {
138 if ( angle_acos >= 0 ) {
141 return (M_PI - angle_asin);
144 if ( angle_acos >= 0 ) {
145 return (2 * M_PI + angle_asin);
147 return (M_PI - angle_asin);
152 template <
typename ValueT >
156 return ( _angle / M_PI * 180);
159 template <
typename ValueT >
163 return ( _angle / 180 * M_PI );
Namespace providing different geometric functions concerning angles.
ValueT getAngle(const ValueT &_cos, const ValueT &_sin)
bool isNan(double x)
Return false if x is not a number.
ValueT degToRad(const ValueT &_angle)
Functions for geometric operations related to angles.
ValueT radToDeg(const ValueT &_angle)
ValueT angleDist(const ValueT &angle0, const ValueT &angle1)
T sane_aarg(T _aarg)
Trigonometry/angles - related.
ValueT getFullangle(VectorT _vector1, VectorT _vector2, const VectorT &_normal, bool &_skip)