function [DIS, r1, r2]= root(a,b,c) % function [DIS, r1, r2]= root(a,b,c) % purpose: finds the roots of a quadratic polynomial. %Inputs: 3 variables a,b,c %Output: Discrimant, two roots. % E.g: a=1;b=2;c=1; DIS=sqrt(b^2 -4*a*c); r1= (-b + DIS)/(2*a) ; r2= (-b - DIS)/(2*a) ;