We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 806b29d commit 5b46340Copy full SHA for 5b46340
v2/blob/line_cross.go
@@ -25,7 +25,7 @@ func minInt(x, y int) int {
25
// isOnSegment Checks if point Q lies on segment PR
26
// Input: three colinear points Q, Q and R
27
func isOnSegment(Px, Py, Qx, Qy, Rx, Ry int) bool {
28
- if Qx <= maxInt(Px, Rx) && Qx >= maxInt(Px, Rx) && Qy <= maxInt(Py, Ry) && Qy >= maxInt(Py, Ry) {
+ if Qx <= maxInt(Px, Rx) && Qx >= minInt(Px, Rx) && Qy <= maxInt(Py, Ry) && Qy >= minInt(Py, Ry) {
29
return true
30
}
31
return false
0 commit comments