Returns true if the point z lies in or on the bounding box of a,b,c, and d.
| 1236 | // Returns true if the point z lies in or on the bounding box |
| 1237 | // of a,b,c, and d. |
| 1238 | static bool |
| 1239 | insidebbox(const Point& a, |
| 1240 | const Point& b, |
| 1241 | const Point& c, |
| 1242 | const Point& d, |
| 1243 | const Point& z) |
| 1244 | { |
| 1245 | RectD bbox; |
| 1246 | |
| 1247 | bbox.x1 = std::numeric_limits<double>::infinity(); |
| 1248 | bbox.x2 = -std::numeric_limits<double>::infinity(); |
| 1249 | bbox.y1 = std::numeric_limits<double>::infinity(); |
| 1250 | bbox.y2 = -std::numeric_limits<double>::infinity(); |
| 1251 | bbox.merge( RectD(a.x, a.y, a.x, a.y) ); |
| 1252 | bbox.merge( RectD(b.x, b.y, b.x, b.y) ); |
| 1253 | bbox.merge( RectD(c.x, c.y, c.x, c.y) ); |
| 1254 | bbox.merge( RectD(d.x, d.y, d.x, d.y) ); |
| 1255 | |
| 1256 | return bbox.contains(z.x, z.y); |
| 1257 | } |
| 1258 | |
| 1259 | inline static |
| 1260 | bool |
no test coverage detected