[英]How to find the X coordinate of a point on a line given another point of the line and the 2 points on a perpendicular line?
這更像是一個數學問題,而不是一個numpy問題。
(AB)的斜率是(y_a - y_b)/ (a - b)
。 因此,任何垂直於(AB)的斜率是p=(ba)/(y_a-y_b)
(與原始斜率的倒數相反)。
從這里可以很容易地確定通過B的垂直於(AB)的方程式: y-y_b=p*(x-x_b)
。 並將y_c
替換為y
以查找x_c
如果(AB)是水平的(0斜率),則存在問題(除以零)。 在這種情況下, x_c
只是x_b
((BC)上的所有點都具有相同的x坐標)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.