Return true if point z is on z0--z1; otherwise compute contribution to winding number.
| 1268 | // Return true if point z is on z0--z1; otherwise compute contribution to |
| 1269 | // winding number. |
| 1270 | static |
| 1271 | bool |
| 1272 | checkstraight(const Point& z0, |
| 1273 | const Point& z1, |
| 1274 | const Point& z, |
| 1275 | int* count) |
| 1276 | { |
| 1277 | if ( (z0.y <= z.y) && (z.y <= z1.y) ) { |
| 1278 | double side = orient2d(z0, z1, z); |
| 1279 | if ( (side == 0.0) && inrange(z0.x, z1.x, z.x) ) { |
| 1280 | return true; |
| 1281 | } |
| 1282 | if ( (z.y < z1.y) && (side > 0) ) { |
| 1283 | *count = *count + 1; |
| 1284 | } |
| 1285 | } else if ( (z1.y <= z.y) && (z.y <= z0.y) ) { |
| 1286 | double side = orient2d(z0, z1, z); |
| 1287 | if ( (side == 0.0) && inrange(z0.x, z1.x, z.x) ) { |
| 1288 | return true; |
| 1289 | } |
| 1290 | if ( (z.y < z0.y) && (side < 0) ) { |
| 1291 | *count = *count - 1; |
| 1292 | } |
| 1293 | } |
| 1294 | |
| 1295 | return false; |
| 1296 | } |
| 1297 | |
| 1298 | // returns true if point is on curve; otherwise compute contribution to |
| 1299 | // winding number. |
no test coverage detected