Given two points I would like to find where the line joining them intersects an arbitrary axis. For example, if I had one point $(5, 10)$ and another at $(50, 100)$ I can be sure that somewhere a line joining these two points will intersect a line running parallel to the $x$ axis with the $y$ value of $23$. Is it possible to determine the $x$ value at this point of intersection?
Finding the intersection of two points and an arbitrary axis
2 Answers
The equation of a straight line is
$y=mx+b.\qquad (1)$
If the line passes through $P_{1}(x_{1},y_{1})$, then
$y_{1}=mx_{1}+b\qquad (2)$
and
$b=y_{1}-mx_{1}.\qquad (3)$
If it passes through $P_{2}(x_{2},y_{2})$, then
$y_{2}=mx_{2}+b.\qquad (4)$
The difference $(4)-(2)$ gives
$y_{2}-y_{1}=m(x_{2}-x_{1}).\qquad (5)$
Hence $(1)$ becomes
$y=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}x+y_{1}-\frac{y_{2}-y_{1}}{x_{2}-x_{1}}% x_{1}.\qquad (6)$
For $P_{1}(5,10),P_{2}(50,100)$, the equation $(5)$ is
$y=\frac{100-10}{50-5}x+10-\frac{100-10}{50-5}5,\qquad (7)$
which is equivalent to
$y=2x.\qquad (8)$
For $y=23$, you have
$23=2x.\qquad (9)$
Thus
$x=\frac{23}{2}.\qquad (10)$
You can use the two point form of the equation for a line. For your example, it is $\frac{y-10}{x-5}=\frac{100-10}{50-5}$ Your line parallel to the $x$ axis is $y=23$. So plug that into the first equation and solve for $x$.