are two points lined up (on a straight line)? */
| 701 | |
| 702 | /* are two points lined up (on a straight line)? */ |
| 703 | boolean |
| 704 | online2(coordxy x0, coordxy y0, coordxy x1, coordxy y1) |
| 705 | { |
| 706 | int dx = x0 - x1, dy = y0 - y1; |
| 707 | /* If either delta is zero then they're on an orthogonal line, |
| 708 | * else if the deltas are equal (signs ignored) they're on a diagonal. |
| 709 | */ |
| 710 | return (boolean) (!dy || !dx || dy == dx || dy == -dx); |
| 711 | } |
| 712 | |
| 713 | #ifndef STRNCMPI |
| 714 | /* case-insensitive counted string comparison */ |