Hi I need to find the distance between two non-parallel line at some point on the plane. Below image will show what I really need to achieve.
Where I know the points P1,P2,P3,P4 and C.
How can I find the distance between the line from point C.
Hi I need to find the distance between two non-parallel line at some point on the plane. Below image will show what I really need to achieve.
Where I know the points P1,P2,P3,P4 and C.
How can I find the distance between the line from point C.
Let us use algebra and name $(x_i,y_i)$ the coordinates of point $P_i$.
The equation for the line going trough points $P_1,P_4$ is $$y=\alpha + \beta x\qquad \beta=\frac{y_1-y_4}{x_1-x_4}\qquad \alpha=y_1-\beta x_1$$ The line going trough points $P_2,P_3$ is $$y=\gamma + \delta x\qquad \delta=\frac{y_2-y_3}{x_2-x_3}\qquad \gamma=y_2-\delta x_2$$ The equation of the line going though point $C$ is $$y=y_C+m(x-x_C)$$ So, the points of intersection are given by $$X_1=\frac{\alpha +m x_C-y_C}{m-\beta }\qquad Y_1=\frac{\alpha m+\beta m x_C-\beta y_C}{m-\beta }$$ $$X_2=\frac{\gamma +m x_C-y_C}{m-\delta }\qquad Y_2=\frac{\gamma m+\delta m x_C-\delta y_C}{m-\delta }$$ and the square of distance between the points is $$D^2=(X_1-X_2)^2+(Y_1-Y_2)^2$$ which is a function of $m$.
Now, if you want the shortest distance, you need to solve for $m$ equation $$\frac d {dm}D^2=0$$ This is ugly if we do not use numbers but very easy otherwise.
m to use in above equation. Also the points Xc and Yc are x,y co-ordinates of point C right?
– Haris
May 26 '17 at 10:04