Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

enter image description here

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.

share|improve this question
1  
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? –  J. M. 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
1  
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. –  J. M. Dec 18 '11 at 4:06

1 Answer 1

Ok, easy way to solve this is as follows:

  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
  3. intersection between lines works only in 2d plane. (check the algorithm from wikipedia under line-line intersection)
  4. then you end up with 4 2d points, and need to convert them back to 3d.
share|improve this answer
2  
Rather circuitous to project when the problem's planar to begin with, no? –  J. M. Dec 17 '11 at 14:05
    
well, his math was suitable for both 2d or 3d... Just had to make sure that wasn't the problem. –  tp1 Dec 17 '11 at 15:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.