Ae = [ 2 1; 1 2]; // ellipse Ah = [ 1 4; 4 3]; // hyperbola Ap = [ 1 1; 1 1]; // parabola Lspace=-2:0.2:2; // Linear spacing n =size(Lspace,2); Ze = zeros(n,n); Zh = zeros(n,n); Zp = zeros(n,n); for i = 1:n, for j = 1:n X = [Lspace(i), Lspace(j)]; Ze(i,j) = X*Ae*X'; Zh(i,j) = X*Ah*X'; Zp(i,j) = X*Ap*X'; end; end; scf(2); clf(); a=get("current_axes"); a.isoview="on"; // aspect ratio 1:1 square(-2,-2,2,2); // window ratio 1:1 id = color("darkgreen"); // define dark green contour2d(Lspace,Lspace,Ze,[-1,1],style=[2,2]); contour2d(Lspace,Lspace,Zh,[-1,1],style=[5,5]); contour2d(Lspace,Lspace,Zp,[-1,1],style=[id,id]); //xtitle('Scilab Conic Contour Plots','x','y'); legend('Parallel Lines','Ellipse','Hyperbola'); xs2eps(2,'contour.eps');