| 9 | namespace obe::Transform |
| 10 | { |
| 11 | UnitVector rotatePointAroundCenter( |
| 12 | const UnitVector& center, const UnitVector& Around, double angle) |
| 13 | { |
| 14 | const double cY = std::cos(angle); |
| 15 | const double sY = std::sin(angle); |
| 16 | |
| 17 | UnitVector moved; |
| 18 | const UnitVector delta = Around - center; |
| 19 | moved.x = (delta.x * cY - delta.y * sY) + center.x; |
| 20 | moved.y = (delta.x * sY + delta.y * cY) + center.y; |
| 21 | |
| 22 | return moved; |
| 23 | }; |
| 24 | |
| 25 | double Rect::getRotation() const |
| 26 | { |
no outgoing calls
no test coverage detected