Archived

This topic is now archived and is closed to further replies.

Spintwo

Two Questions

Recommended Posts

How do you figure out the equation for a perpendicular line to a given line where both lines intersect at a certain point? I''m guessing that this can be done with matrices. Example: the Given: 3x+2y=5 Now we want to figure out the equation of the perpendicular line that intersects the given at point (1,1). I know that the slopes have to equal -1 to become perpendicular and if the certain point of intersection was not important, this would be obvious. But now with that, how do you do it? the matrix for the original equation would be
[3 2]*[x]=[5]
      [y]
 
But how do you implement the unknowns and where do you put the (1,1) into here? ---------------------------------------- How do you find transformations that maps for example,
[2 -3 0]
[1  4 6]
 
unto
[ 1 4 6]
[-2 3 0]
?
 
I tried first to find the transformation matrix by doing (t and m1 and m2 are matrices) (t)(m1)=(m2) then finding the inverse of m1 and multiplying that to m2 but in this case, finding the inverse is not possible because the matrix is not square. If this had worked, I would have taken the transformation matrix and then compared it to the identity matrix to figure out the degree of the transformation. So since that doesn''t work, how do we do it with matrices?
Charles Hwang -aka oatmeal.net [Maxedge My Site(UC)|E-mail|NeXe|NeHe|SDL] [Google|Dev-C++|GDArticles|C++.com|MSDN]

Share this post


Link to post
Share on other sites
I can answer your fisrt question. It''s basic coordinate-geometry.

So you first line: ax+by=c
From this the normal vector is [a,b]
A vector perpendicular to this is [-b,a]
Then you create a line with this normal vector and with a point that is on it.
The point is P(x0,y0)

Then your new line is: -b(x-x0)+a(y-y0)=0
You have to use such a P point, which is on the first line, at the desired intersection.

Share this post


Link to post
Share on other sites
say you have a line(P, D) defined by point P and direction D
a perpendicular line (Q, E) would have direction E = Vector(-D.y, D.x);

given that Q is already given (it''s the point of intersection between two lines), the line is (Q, E = Vector(-D.y, D.x))

it''s in parametric form, but it should be easy to convert it to non-parametric form, but I''m too tired to work it out

Share this post


Link to post
Share on other sites