| 96 | } |
| 97 | |
| 98 | static double arcAngle(Vector2 u, Vector2 v) { |
| 99 | return nonZeroSign(crossProduct(u, v))*acos(clamp(dotProduct(u, v)/(u.length()*v.length()), -1., +1.)); |
| 100 | } |
| 101 | |
| 102 | static Vector2 rotateVector(Vector2 v, Vector2 direction) { |
| 103 | return Vector2(direction.x*v.x-direction.y*v.y, direction.y*v.x+direction.x*v.y); |
no test coverage detected