0
$\begingroup$

Let say i have two parallel lines, $L_1$ and $L_2$,

enter image description here

Now how to Transform line $L_2$ in to $L_1$.

  • 0
    What do you mean by transform? If you mean two lines (not segments) on a plane, you could use two symmetries, to just translate it. Even single symmetry would do if you don't care about the sign.2012-04-14
  • 0
    I mean two line segments. I need to transform L2 into L1. Means, L2 and L1 become same lines.2012-04-14
  • 0
    If the two segments are of the same length, you just translate, no?2012-04-14
  • 0
    @J.M., yes u are right2012-04-14
  • 0
    @dtldarek, can you explain a little more.2012-04-14
  • 0
    @user960567 The comment was too short, see below ;-)2012-04-14

2 Answers 2

1

You want to transform point $(x1,y1)$ to $(x2,y2)$, and $(x3,y3)$ to $(x4,y4)$. This means: $$\left( \begin{array}{cc} a & b \\ c & d \end{array} \right) \cdot \left( \begin{array}{c} x1 \\ y1 \end{array} \right) = \left( \begin{array}{c} x2 \\ y2 \end{array} \right) $$ And: $$\left( \begin{array}{cc} a & b \\ c & d \end{array} \right) \cdot \left( \begin{array}{c} x3 \\ y3 \end{array} \right) = \left( \begin{array}{c} x4 \\ y4 \end{array} \right) $$

You have four equations in the four unknowns $a,b,c,d$. Once you solve these equations the transformed coordinates $(x',y')$ are related to the old ones by: $$\left( \begin{array}{cc} a & b \\ c & d \end{array} \right) \cdot \left( \begin{array}{c} x \\ y \end{array} \right) = \left( \begin{array}{c} x' \\ y' \end{array} \right) $$

  • 0
    I don't understand.2012-04-14
  • 0
    I think some of those $c$s were meant to be $d$s, nbubis.2012-04-14
  • 0
    @GerryMyerson - Thanks, Fixed.2012-04-14
  • 0
    @user960567 - Do you want to explain what you don't understand? Are you familiar with matrix multiplication?2012-04-14
  • 0
    Yup. I am thinking, X2 + (X1 - X2), Y2 + (Y1 - Y2) may work or not2012-04-14
  • 0
    nbubis, @GerryMyerson Yup. I am thinking simple subtraction may work or not. Because the difference between, X1,Y1 - X2,Y2 and X3,Y3 - X4,Y4 is same2012-04-14
  • 0
    You mean the lines are of equal length? then yes, subtraction will work in that case.2012-04-14
1

The comments are too short, so I will explain it here. Let $A = (X_1, Y_1)$, $B = (X_2, Y_2)$, $C = (X_3, Y_3)$ and $D = (X_4, Y_4)$. We have that $AC\ \|\ BD$ and that you want to transform $A$ to $B$ and $C$ to $D$ (of course the same approach can be used to map $A$ to $D$ and $C$ to $B$). The notation $|PQ|$ means the length of $PQ$.

First of all, there are infinitely many transformations that would map $AC$ to $BD$ (without any constraints, if you assume that you want your map to be of some specific class, there may be just a few or even none), and I will just give you an example of such transformation.

What I will construct is called usually homothety or simply scaling, and this is one of the basic geometry transformations (along with rotation, translation and symmetry).

To start we need the center, let call it $S = (S_x, S_y)$. However, we know that $S$ is a point on the line passing through $A$ and $B$, and also on the line passing through $C$ and $D$. Therefore, $S$ is the intersection of those two lines (with the special case I will deal later). To apply the transformation to the point say $P$, just draw a line $SP$ and then set $P'$ on the same line, but with $|SP'| = \frac{|BS|}{|AS|}|SP| = \frac{|DS|}{|CS|}|SP|$ (where positive sign means $X'$ is on the same side as $X$, and the negative sign denotes opposite side). Please, compare it with Intercept theorem (in my country this is known as Thales' theorem). To give algebraic formula: $$T(P) = \frac{|BS|}{|AS|}(P-S) + S$$ or written more explicitly: $$T(P_x, P_y) = \left(\frac{|BS|}{|AS|}(P_x-S_x)+S_x, \frac{|BS|}{|AS|}(P_y-S_y)+S_y\right)$$

As you can see, if $S = (0,0)$ then this becomes a simple scaling. There is a special case when $AB\ \|\ CD$, i.e. when $S$ does not exists, or as some like to say $S$ is in infinity. But in this degenerate case homothety becomes just translation, so $$T(P) = P+AB$$ or $$T(P_x, P_y) = (P_x + B_x - A_x, P_y + B_y - A_y)$$

Hope that helps ;-)

  • 0
    Isn't this is some how complex. What about taking the difference? I mean subtraction2012-04-14
  • 0
    @user960567 What do you mean?2012-04-14
  • 0
    See below comments.2012-04-15