return the difference f1-f2 in the range [-pi;pi] a negative return value means f1 is CCW from f2.
| 52 | // return the difference f1-f2 in the range [-pi;pi] |
| 53 | // a negative return value means f1 is CCW from f2. |
| 54 | float facingDistance(float f1, float f2) |
| 55 | { |
| 56 | float result = f1 - f2; |
| 57 | while (result > M_PI) |
| 58 | { |
| 59 | result -= M_2xPI; |
| 60 | } |
| 61 | while (result <= -M_PI) |
| 62 | { |
| 63 | result += M_2xPI; |
| 64 | } |
| 65 | return result; |
| 66 | } |
| 67 | } // namespace |
| 68 | |
| 69 | template <> const UString &StateObject<Vehicle>::getPrefix() |