| 2307 | //------------------------------------------------------------------------------ |
| 2308 | |
| 2309 | DoublePoint GetUnitNormal( const IntPoint &pt1, const IntPoint &pt2) |
| 2310 | { |
| 2311 | double dx = static_cast<double>(pt2.X - pt1.X); |
| 2312 | double dy = static_cast<double>(pt2.Y - pt1.Y); |
| 2313 | if( ( dx == 0 ) && ( dy == 0 ) ) return DoublePoint( 0, 0 ); |
| 2314 | |
| 2315 | double f = 1 *1.0/ std::sqrt( dx*dx + dy*dy ); |
| 2316 | dx *= f; |
| 2317 | dy *= f; |
| 2318 | return DoublePoint(dy, -dx); |
| 2319 | } |
| 2320 | //------------------------------------------------------------------------------ |
| 2321 | |
| 2322 | Polygons OffsetPolygons(const Polygons &pts, const float &delta) |
no test coverage detected