function [r1, r2] = quadratic_solve(a,b,c)
%solves ax^2+bx+c using quadratic formula

d = b^2-4*a*c;
r1 = -b + sqrt(d)/(2*a);
r2 = -b - sqrt(d)/(2*a);

%if the user enters 1 output argument
if nargout <2
    r1 = [r1,r2];
end
end
