# Create parallel line and find intersection with other line

I'm trying to create parallel lines of the bold, black lines in this picture:

It is just an arbitrary (convex) quadrilateral, with the blue corner points known. The bold, black lines start at 25% of each blue line and end at 75%. So, say $\lambda_1 = 0.25$ and $\lambda_2 = 0.75$, then

\begin{align} Start = \lambda_1 \cdot c_2 + (1-\lambda_1) \cdot c_1 \\ End = \lambda_2 \cdot c_2 + (1-\lambda_2) \cdot c_1 \end{align}

Where $c_1$ and $c_2$ are the two points of a blue line.

Now my actual questions. 1.) How to create a parallel line to such a bold black line? It should have the same length, and be guided along the dashed green line towards the centroid. If I'm not mistaken, the centroid is at the intersection of the two bimedians (the dashed green lines). Since it is a quadrilateral, this should be the same as the mean value of the 4 points at the corners. Therefore, the centroid is known as well.

2.) Ok, so say I got the parallel lines. Then I move them all towards the centroid, until their endpoints touch, creating a scaled-down version of this quadrilateral. Is there a way to obtain the coordinates of these 4 new corner points in general?

By the way, I did a search and came up with this topic, but there it is guided along the perpendicular line, and my green dashed lines are not perpendicular to the blue/black ones.

Edit: The equation for a dashed green line from the center of the blue line towards the centroid would be

\begin{align} \lambda \cdot C + (1 - \lambda) \cdot \left( \frac{c_1+c_2}{2} \right) \end{align}

Where $C$ is the centroid. The equation for a bimedian would be

\begin{align} \gamma \cdot \left( \frac{c_3+c_4}{2} \right) + (1 - \gamma) \cdot \left( \frac{c_1+c_2}{2} \right) \end{align}

So somehow, the $Start$ and $End$ points must be moved in the direction of one of these lines above, in order to create a $NewStart$ and $NewEnd$ point. Then the equation for the parallel line would simply be

\begin{align} \eta \cdot NewEnd + (1-\eta) \cdot NewStart \end{align}

Once the 4 expressions for the parallel lines are known, the intersection can be calculated, hopefully resulting in a relatively easy expression for the 4 new corner points.

-
Here's a thought: you know that the black segments are half the scale of the blue segments, no? Why can't you shift things such that the centroid's at the origin, apply a scaling transformation, and then shift back to the original centroid? –  Guess who it is. Dec 17 '11 at 14:22
That's actually a very good idea, I was so focused on a single line that I didn't think of that! Ok, I'm going to work it out and see what expressions for the 4 corner points I can find. –  Ailurus Dec 17 '11 at 14:46
The vertices of the reduced quadrilateral are the midpoints of the lines $Cc_1,Cc_2,Cc_3,Cc_4$. –  Américo Tavares Dec 17 '11 at 15:18
That's right Américo, once you work out J.M.'s idea for a point, you get this result. For instance, take $c_1$ and calculate the new position $\hat{c_1}$. First shift everything such that the centroid is at the origin (so subtract $C$). Then scale with $1 \over 2$. Finally, add $C$ to go back to the original centroid. So, $\hat{c_1} = {1 \over 2} (c_1 - C) + C$ which equals ${1 \over 2} (c_1 + C)$. –  Ailurus Dec 17 '11 at 16:06
As a reminder, Ailurus: if you've figured it out, please write what you have as an answer, and then maybe accept it. –  Guess who it is. Dec 18 '11 at 4:06

1. Represent the lines as two points $(x_1,y_1,z_1), (x_2,y_2,z_2)$
2. Require them to be in same plane, and convert $(x,y,z) : R \times R \times R$ to $(x,y) : R \times R$ to get plane coordinates; a projection from 3d space to a 2d plane is a good choice for this