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 found this page on the intersection of 2 lines. And I'm really surprised about going from:

$$\begin{align*} x_1 + u_a (x_2 - x_1) &= x_3 + u_b (x_4 - x_3) \\\ y_1 + u_a (y_2 - y_1) &= y_3 + u_b (y_4 - y_3) \end{align*}$$

to this

$$\begin{align*} u_a &= \frac{(x_4 - x_3)(y_1 - y_3) - (y_4-y_3)(x_1-x_3)}{(y_4-y_3)(x_2-x_1)-(x_4-x_3)(y_2-y_1)} \\\ u_b &= \frac{(x_2-x_1)(y_1-y_3)-(y_2-y_1)(x_1-x_3)}{(y_4-y_3)(x_2-x_1)-(x_4-x_3)(y_2-y_1)} \end{align*}$$

Could somebody carry it for me cause I always fail and get other final equation.

share|improve this question
    
typo in the title –  Pierre-Yves Gaillard Aug 20 '11 at 12:52
    
@Pierre, took it upon myself to fix it. –  Gerry Myerson Aug 20 '11 at 12:56
2  
A useful keyword in this context is Cramer's rule and a detailed answer to your question is written here: en.wikipedia.org/wiki/… –  Did Aug 20 '11 at 13:10
    
@Gerry: Thanks! (I don't have edit privileges.) –  Pierre-Yves Gaillard Aug 20 '11 at 13:17
add comment

2 Answers

Rewrite the equations as $$ \begin{align} u_a(x_2-x_1)+u_b(x_3-x_4)&=x_3-x_1\\ u_a(y_2-y_1)+u_b(y_3-y_4)&=y_3-y_1 \end{align} $$ Then solve using Cramer's Rule: $$ \begin{align*} u_a&=\frac{\begin{vmatrix}x_3-x_1&&x_3-x_4\\y_3-y_1&&y_3-y_4\end{vmatrix}}{\begin{vmatrix}x_2-x_1&&x_3-x_4\\y_2-y_1&&y_3-y_4\end{vmatrix}}\\ &=\frac{(x_3-x_1)(y_3-y_4)-(y_3-y_1)(x_3-x_4)}{(x_2-x_1)(y_3-y_4)-(y_2-y_1)(x_3-x_4)} \end{align*} $$ and $$ \begin{align*} u_b&=\frac{\begin{vmatrix}x_2-x_1&&x_3-x_1\\y_2-y_1&&y_3-y_1\end{vmatrix}}{\begin{vmatrix}x_2-x_1&&x_3-x_4\\y_2-y_1&&y_3-y_4\end{vmatrix}}\\ &=\frac{(x_2-x_1)(y_3-y_1)-(y_2-y_1)(x_3-x_1)}{(x_2-x_1)(y_3-y_4)-(y_2-y_1)(x_3-x_4)} \end{align*} $$ which after some negations in the numerator and denominator that cancel, gives the answer you cite.

share|improve this answer
    
Teeny-tiny note: you can use the vertical bars, or you can use $\det$. Using both at the same time, though, looks sorta kinda redundant... :) –  J. M. Aug 21 '11 at 15:12
    
@J. M.: Thanks. I was thinking $\det$, so I subconsciously used vertical bars instead of square brackets. –  robjohn Aug 21 '11 at 15:50
add comment

Rewrite as $Au_a+Bu_b=C,Du_a+Eu_b=F$ where $A=x_2-x_1,B=-(x_4-x_3),C=x_3-x_1,D=y_2-y-1,E=-(y_4-y_3),F=y_3-y_1$. Multiply first equation by $E$, second by $B$, subtract to get $(EA-BD)u_a=EC-BF$, so $$u_a={EC-BF\over EA-BD}={-(y_4-y_3)(x_3-x_1)+(x_4-x_3)(y_3-y_1)\over-(y_4-y_3)(x_2-x_1)+(x_4-x_3)(y_2-y-1)}$$ Then do a little fiddling to see if this is the given answer. Then do a similar thing to get $u_b$.

share|improve this answer
    
See also Cramer's rule. –  Hans Lundmark Aug 20 '11 at 13:08
add comment

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.