반응형 pointInPolygon1 [Useful] point in polygon algorithm (javascript) point in polygon algorithm (insidePolygon) javascript function pointInPolygon(mouseX, mouseY) { var inside = false var i,j = 0 for(i = 0,j = vertexCount - 1; i mouseY) != (vertexList[j].y > mouseY)) && (mouseX < (vertexList[j].x - vertexList[i].x) * (mouseY - vertexList[i].y) / (vertexList[j].y - vertexList[i].y) + vertexList[i].x)) { inside = !i.. 2024. 4. 14. 이전 1 다음 반응형