질문은 이겁니다.
각각 두점을 지나는 직선이 만나는 점을 구하는 공식을 알려달라고 질문을 적었습니다.
그랬더니 달리는 답변
The mathematical formula for finding the point where two lines intersect is given by the following system of linear equations:
Let's say we have two lines with points (x1, y1), (x2, y2) and (x3, y3), (x4, y4). The lines can be represented as:
y = m1 * x + b1 and y = m2 * x + b2
Where m1 and m2 are the slopes of the lines and b1 and b2 are the y-intercepts. The slopes can be calculated as:
m1 = (y2 - y1) / (x2 - x1) m2 = (y4 - y3) / (x4 - x3)
And the y-intercepts can be calculated as:
b1 = y1 - m1 * x1 b2 = y3 - m2 * x3
Now, we can find the point of intersection (x, y) by solving the system of linear equations:
x = (b2 - b1) / (m1 - m2) y = m1 * x + b1 = m2 * x + b2
This will give us the x and y coordinates of the point where the two lines intersect.
틀리지 않고 정확하게 알려 주더군요.
로봇으로 필요하면 비젼 또는 측정된 값을 이용해서 정확한 위치를 찾아 낼 필요 가 있는겅우 복잡한 수식이 필요 한데 예전엔 수학이 후달려 엄청 고생하며 만들거나 인터넷에 검색해가며 찾은 공식을 정말 간단하게 수식을 뽑아 주네요.
이미 프로그래밍 코드뽑아내는게 가능한 수준이라고 하니 이정도는 당연하다고 보긴 하는데 막상 경험 하니 진짜 어마어마 합니다.
수식이 필요한 프로그램 만들때 정말 도움 되겠더군요.