| 2289 | }; |
| 2290 | |
| 2291 | Polygon BuildArc(const IntPoint &pt, |
| 2292 | const double a1, const double a2, const double r) |
| 2293 | { |
| 2294 | int steps = std::max(6, int(std::sqrt(std::abs(r)) * std::abs(a2 - a1))); |
| 2295 | Polygon result(steps); |
| 2296 | int n = steps - 1; |
| 2297 | double da = (a2 - a1) / n; |
| 2298 | double a = a1; |
| 2299 | for (int i = 0; i <= n; ++i) |
| 2300 | { |
| 2301 | result[i].X = pt.X + Round(std::cos(a)*r); |
| 2302 | result[i].Y = pt.Y + Round(std::sin(a)*r); |
| 2303 | a += da; |
| 2304 | } |
| 2305 | return result; |
| 2306 | } |
| 2307 | //------------------------------------------------------------------------------ |
| 2308 | |
| 2309 | DoublePoint GetUnitNormal( const IntPoint &pt1, const IntPoint &pt2) |
no test coverage detected