1. koeficient a:
2. koeficient b:

Kořen:  

 
 
if (a != 0) {
  x = -b/a;
} else {
  alert ("Nejedná se o lineární rovnici");
}