첫 번째 두 줄 사이에 세 개의 원을 그리는 작은 프로그램을 만들고 그 다음에 세 번째 줄이 닿거나 교차하는지 확인해야합니다. 나는 마지막 부분을 제외한 모든 것을 다했다. 영역을 0으로 결정하기 위해 포인트를 사용하려고합니다. 이는 세 번째 포인트가 실제로 라인을 교차한다는 것을 의미합니다. 권리? 아니면 다른 방법을 사용할 수도 있습니다. 기술적으로 세 번째 원은 선의 3 픽셀 내에있을 수 있습니다. 문제는 해시 태그 하단에 있습니다. 이것을 다른 방향으로 옮기는 데 도움이나 제안을 해주시면 감사하겠습니다. 고맙습니다. 3 원거북선 교차점, 좌표
import turtle
x1, y1 = eval(input("Enter coordinates for the first point x, y: "))
x2, y2 = eval(input("Enter coordinates for the second point x, y: "))
x3, y3 = eval(input("Enter coordinates for the third point x, y: "))
turtle.penup()
turtle.goto(x1, y1)
turtle.pendown()
turtle.circle(3)
turtle.penup()
turtle.goto(x2, y2)
turtle.pendown()
turtle.circle(3)
turtle.penup()
turtle.goto(x3, y3)
turtle.pendown()
turtle.circle(3)
turtle.penup()
turtle.color("red")
turtle.goto(x1, y1)
turtle.pendown()
turtle.goto(x2, y2)
a = (x1, y1)
c = (x3, y3)
#can't multiply sequence by non-int of type 'tuple'
area = (a * c)/2
if area == 0:
print("Hit")
else:
print("Miss")