Given 𝑃1 and 𝑃2, how do you calculate 𝑃3 and 𝑃4 after shortening the line segment by equal distance on each point

geometrylinear algebratrigonometry

Let's say I have a line segment given 𝑃1 and 𝑃2. I can calculate the Distance between the two, and the Slope, which will help.

I want to 'shorten' the line segment by equal Distance X on both points of the line segment. Therefore, 𝑃1 and 𝑃2 will move X distance closer to each other producing new points 𝑃3 and 𝑃4. Together these new points will be a 'shortened' line segment, with the same exact slope and intermediate points between the 𝑃3 and 𝑃4.

How Do I calculate 𝑃3 and 𝑃4? (assuming both are the same process)

Best Answer

Suppose distance between points $P,Q$ be denoted by $d(P,Q)$. Then you can find $d(P_1,P_2)$, call it $D$.

$P_3$ divides the segment $\overline{P_1P_2}$ internally in the ratio $X:(D-X)$, so you can use the section formula $$ P_3 = \dfrac{(D-X)P_1+XP_2}D \tag{1}$$

and $P_4$ divides the segment $\overline{P_1P_2}$ internally in the ratio $(D-X):X$, so $$ P_4 = \dfrac{XP_1+(D-X)P_2}D$$

Note: If $P$ has coordinates $(x_P,y_P)$ (assuming you are working with $2$ coordinates, it works for any number of coordinates), then for $P_3=(x_{P_3},y_{P_3})$, $(1)$ means "apply it to each coordinate of $P_2$ and $P_3$", i.e. $$x_{P_3}=\dfrac{(D-X)\cdot x_{P_1}+X\cdot x_{P_2}}D\\ y_{P_3}=\dfrac{(D-X)\cdot y_{P_1}+X\cdot y_{P_2}}D$$

Related Question