function y = conic(phi, param)
%CONIC.M generates a conic section whose equation is given in polar form.
% The function has two array arguments:
% phi, the polar angle coordinate, and param = [ p e ],
% where p is the parameter, and e the excentricity.
% See book, Example 10.4.
p = param(1);
e = param(2);
r = p*ones(phi)./(1 + e*cos(phi));
polar(phi, r)
grid
if e < 1
t1 = 'Ellipse, ';
elseif e == 1
t1 = 'Parabola, ';
else
t1 = 'Hyperbola, ';
end
t2 = 'p = ';
t3 = ', e = ';
title([ t1 t2 num2str(p) t3 num2str(e) ]);