Return which side of the line does a point lie
| 600 | |
| 601 | // Return which side of the line does a point lie |
| 602 | inline constexpr int32_t side(const olc::v_2d<T>& point) const |
| 603 | { |
| 604 | double d = vector().cross(point - start); |
| 605 | if (d < 0) |
| 606 | return -1; |
| 607 | else |
| 608 | if (d > 0) |
| 609 | return 1; |
| 610 | else |
| 611 | return 0; |
| 612 | } |
| 613 | |
| 614 | // Returns line equation "mx + a" coefficients where: |
| 615 | // x: m |