b2Angle.cpp 304 B

123456789101112131415161718
  1. //
  2. // Created by jovian on 31/07/17.
  3. //
  4. #include "b2Angle.h"
  5. float b2Angle(const b2Vec2 &u, const b2Vec2 &v) {
  6. float rep(std::acos(b2Dot(u, v)));
  7. if ( b2Cross(u, v) > 0.0f )
  8. rep *= -1.0f;
  9. return rep;
  10. }
  11. float b2Angle(const b2Vec2 &u) {
  12. return b2Angle(u, b2Vec2(1.0f, 0.0f));
  13. }