Advertisement
dmitrysenkovich

Untitled

Aug 29th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: OSGMath.h
  2. ===================================================================
  3. --- OSGMath.h   (revision 91664)
  4. +++ OSGMath.h   (working copy)
  5. @@ -70,6 +70,22 @@
  6.     return a.x() * b.y() - b.x() * a.y();
  7.  }
  8.  
  9. +/**
  10. + * wrapAngle - Приводит значение угла к соответствующему значению из полуинтервала [-Pi, Pi)
  11. + */
  12. +inline double wrapAngle(double angle)
  13. +{
  14. +   return angle - 2 * M_PI * floor((angle + M_PI) / (2 * M_PI));
  15.  }
  16.  
  17. +/**
  18. + * wrapAngle0_2Pi - Приводит значение угла к соответствующему значению из полуинтервала [0, 2*Pi)
  19. + */
  20. +inline double wrapAngle0_2Pi(double angle)
  21. +{
  22. +   return angle - 2 * M_PI * floor(angle / (2 * M_PI));
  23. +}
  24. +
  25. +}
  26. +
  27.  #endif
  28. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement