오차 범위 수정
This commit is contained in:
parent
937f2eb3fe
commit
902d13b273
@ -533,7 +533,7 @@ export function isPointOnLine({ x1, y1, x2, y2 }, { x, y }, epsilon = 2) {
|
||||
return result <= 10*!*/
|
||||
// 직선 방정식 만족 여부 확인
|
||||
const crossProduct = (y - y1) * (x2 - x1) - (x - x1) * (y2 - y1)
|
||||
if (Math.abs(crossProduct) > 10) return false // 작은 오차 허용
|
||||
if (Math.abs(crossProduct) > 500) return false // 작은 오차 허용
|
||||
|
||||
// 점이 선분의 범위 내에 있는지 확인
|
||||
const withinXRange = Math.min(x1, x2) <= x && x <= Math.max(x1, x2)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user