# projecting lines

Printable View

• January 1st 2009, 08:58 AM
moment
projecting lines
I have a scheme on projecting lines on another line, but I don't know how to calculate the points that are projected on the lines.

I want to calculate them using the coordinates of the rectangle corners.

http://adminpage.site90.com/rect.png
• January 6th 2009, 01:52 AM
Grandad
Projecting lines
Hello moment
Quote:

Originally Posted by moment
I have a scheme on projecting lines on another line, but I don't know how to calculate the points that are projected on the lines.

I want to calculate them using the coordinates of the rectangle corners.

As I understand it, you need to find, using coordinate geometry, the positions of the vertices of rectangles when they are projected onto a series of lines. So, to be specific, I think you're saying that, given a point $P$ (representing a typical vertex of a rectangle) you need to find the position of the projection of $P$ onto a line $l$.

If that's so, then the following may be helpful.

Suppose that $P$ has coordinates $(x_1,y_1)$ and that the equation of the line $l$ is $y = mx + c$. Suppose further that $Q$ is the projection of $P$ onto $l$, and that the coordinates of $Q$ are $(x_2, y_2)$.

Then, because $Q$ lies on $l$:

$y_2 = mx_2 + c$ (1)

and because $PQ \bot l$:

$\frac{y_1-y_2}{x_1-x_2} = -\frac{1}{m}$ (2)

Substitute from (1) into (2):

$\frac{y_1-(mx_2+c)}{x_1-x_2}=-\frac{1}{m}$

$\Rightarrow my_1-m^2x_2-mc=x_2-x_1$

$\Rightarrow my_1 - mc +x_1=x_2(1+m^2)$

$\Rightarrow x_2=\frac{x_1+my_1 - mc}{1+m^2}$ (3)

Substitute into (1):

$y_2 = \frac{mx_1 + m^2y_1 - m^2c + c + cm^2}{1+m^2}$

$\Rightarrow y_2 = \frac{mx_1 + m^2y_1 +c}{1+m^2}$ (4)

So equations (3) and (4) give us the coordinates of Q in terms of $x_1, y_1, m$ and $c$.

Of course, you may be able to simplify these results if you are able to choose a particular origin of coordinates. For example, if the origin can be chosen to lie on the line $l$, then $c = 0$, and equations (3) and (4) simplify to:

$\Rightarrow x_2=\frac{x_1+my_1}{1+m^2}$

$\Rightarrow y_2 = \frac{m(x_1 + my_1)}{1+m^2}$

Or, if you could also choose two lines $l$ at $45^o$ to the axes, then you can make $m = \pm 1$, and the equations would simplify even further to:

$\Rightarrow x_2=\frac{x_1\pm y_1}{2}$

$\Rightarrow y_2 = \frac{y_1 \pm x_1}{2}$

I hope this gives you some ideas.

Grandad