% ShowQuadratic
% Plots random quadratics with real roots.

  close all
  for k=1:10
     [a,b,c] = randomQuadratic;
     [r1,r2] = rootsQuadratic(a,b,c);
     if imag(r1)==0 
        x = linspace(min(r1,r2)-1,max(r1,r2)+1,100);
        y = a*x.^2 + b*x + c;
        plot(x,y,x,0*y,':k',r1,0,'or',r2,0,'or')
     end
     shg
     pause(1)
  end