| 68 | } |
| 69 | |
| 70 | static PointD GetUnitNormal(const Point64& pt1, const Point64& pt2) |
| 71 | { |
| 72 | if (pt1 == pt2) return PointD(0.0, 0.0); |
| 73 | double dx = static_cast<double>(pt2.x - pt1.x); |
| 74 | double dy = static_cast<double>(pt2.y - pt1.y); |
| 75 | double inverse_hypot = 1.0 / Hypot(dx, dy); |
| 76 | dx *= inverse_hypot; |
| 77 | dy *= inverse_hypot; |
| 78 | return PointD(dy, -dx); |
| 79 | } |
| 80 | |
| 81 | inline bool AlmostZero(double value, double epsilon = 0.001) |
| 82 | { |
no test coverage detected