123456789101112131415161718 |
- //
- // Created by jovian on 31/07/17.
- //
- #include "b2Angle.h"
- float b2Angle(const b2Vec2 &u, const b2Vec2 &v) {
- float rep(std::acos(b2Dot(u, v)));
- if ( b2Cross(u, v) > 0.0f )
- rep *= -1.0f;
- return rep;
- }
- float b2Angle(const b2Vec2 &u) {
- return b2Angle(u, b2Vec2(1.0f, 0.0f));
- }
|