Tuesday, December 18, 2007

2d lines intersection point & Linear equations

Do you remember the linear equations studied ? and methods to solve linear equations ?  may be some of us remember it.

We know every line can be represented by a linear equation of the form Ax+by  =c . or in the point slope form y = mx + c.so if you have two lines in the graph  ( or in ur game) you can find the intersecting point by solving these equations. You can find the intersecting point by solving these equations.

For example if you have two lines corresponding to , y = 2x,  and y = 0x+ 3 ( horizontal line ) so certainly these lines will intersect. .slopes are 2 and 0 respectily. so by solving these equations 2x-y =0 , and 0x + y = 3, we will get x = 3/2 and y = 3. 

 So what is the best method for solving linear equations using computers ? There are methods like

1. Linear compostion (normal equation solving , by adding or subtracting 2 equations)
2. gauss elimination method ( using matrixes. i think everybody knows it , no need for explanation. ).
3. Cramer's Rule. ( creating the cofactor matrix and finding determinent , andby dividing with determinent).

So which is the best ? I think gauss elimination is best. Because when the matrix diamension becomes bigger , cramer's method even takes days to find the answer.But Gauss elimination method won't .

No comments: