
I have two points, $P_1$ and $P_2$ as well as a line $Y$. I'm trying to find the $X$ point at which a line, dropped from the midpoint of $P_1P_2$ will hit the line $Y$.
I haven't thought about this stuff in years.
|
I have two points, $P_1$ and $P_2$ as well as a line $Y$. I'm trying to find the $X$ point at which a line, dropped from the midpoint of $P_1P_2$ will hit the line $Y$. I haven't thought about this stuff in years. |
||||
|
|
Given that (I assume) you know the gradient of line P1P2 (if you know the co-ordinates of P1 and P2), you implicitly know the gradient of the line perpendicular to it. You therefore have the gradient and 1 point of that line, and you know the y-axis value of the other point. Plugging all that info into |
|||||||||||
|
|
A solution using dot products: Let $P_m = (p_{m1}, p_{m2})$ be the midpoint of $P_1 = (p_{11}, p_{12})$ and $P_2 = (p_{21}, p_{22})$. Then the point $X$ is such that the vector $P_m X$ has 1) $(P_m X) \cdot (P_1 P_2) = 0$ because the vectors are perpendicular, 2) $X = (x_1, x_2) = (x_1, Y)$ where Y is known. Plugging in: $$(P_m X) \cdot (P_1 P_2) = 0 = (x_1 - p_{m1}, Y - p_{m2}) \cdot (p_{21} - p_{11}, p_{22} - p_{12})$$ $$=(x_1 - p_{m1})(p_{21}-p_{11}) + (Y-p_{m2})(p_{22}-p_{12})$$ Rearranging for $x_1$, $$x_1 = p_{m1} + \frac{(Y-p_{m2})(p_{22}-p_{12})}{(p_{11}-p_{21})}$$ |
|||
|
|
|
You know co-ordinates of P1 and P2 as (x1, y1) and (x2, y2). You can find slope of that line using m = [y1 - y2] / [x1 - x2] The slope of perpendicular line is found by reciprocal of negative of slope. -(1/m) and the mid point can be found using Mid Point formula. Then use point slope y=mx+ c |
|||
|
|
|
With the coordinates of $P_1$ and $P_2$, you can compute the slope of the line containing a segment $\overline{P_1P_2}$
From this relation, you have the slope of the perpendicular line.
|
||||
|
|