| 8 | } |
| 9 | |
| 10 | float Math::angleOfVector(RealVector2D const& v) |
| 11 | { |
| 12 | auto vLength = length(v); |
| 13 | if (vLength < NEAR_ZERO) { |
| 14 | return 0; |
| 15 | } |
| 16 | float angle; |
| 17 | auto angleSin = asinf(-v.y / vLength) * Const::RadToDeg; |
| 18 | if (v.x >= 0.0) { |
| 19 | angle = 90.0 - angleSin; |
| 20 | } else { |
| 21 | angle = angleSin + 270.0; |
| 22 | } |
| 23 | return angle; |
| 24 | } |
| 25 | |
| 26 | RealVector2D Math::rotateQuarterCounterClockwise(RealVector2D v) |
| 27 | { |
nothing calls this directly
no outgoing calls
no test coverage detected