Algoritmul va rezolva urmatorul sistem:
[tex]\left\{\begin{array}{ll}
a_1x+b_1y+c_1=0\\\\
a_2x+b_2y+c_2=0\rightarrow \boxed{y=\frac{-a_2x-c_2}{b_2}}
\end{array}\right\\\\\\
a_1x+b_1(\frac{-a_2x-c_2}{b_2})+c_1=0\\\\
a_1x-\frac{a_2b_1}{b_2}x-\frac{b_1c_2}{b_2}+c_1=0\\\\
x(\frac{a_1b_2-a_2b_1}{b_2})=\frac{b_1c_2-b_2c_1}{b_2}\\\\
\boxed{x=\frac{b_1c_2-b_2c_1}{a_1b_2-a_2b_1}}
[/tex]
Il vom calcula mai intai pe x, apoi il vom calcula pe y in functie de x.
Pseudocodul:
inceput
real a1, b1, c1, a2, b2, c2, x, y
citeste a1, b1, c1, a2, b2, c2
x <- (b1 * c2 - b2 * c1) / (a1 * b2 - a2 * b1)
y <- (-a2 * x - c2) / b2
scrie x, y
sfarsit