Curves of the second order, also known as conic sections, are curves obtained by the intersection of a plane and a double-napped cone. These include ellipses, parabolas, and hyperbolas. They are defined by quadratic equations of the form:
$$ A x^2+B x y+C y^2+D x+E y+F=0 $$
where $A, B, C, D, E, F$ are constants.
Ellipse (includes the Circle)
$$ \frac{(x-h)^2}{a^2}+\frac{(y-k)^2}{b^2}=1 $$
Parabola
General equation:
$$ y=a x^2+b x+c $$
A parabola has one focus and one directrix.
If $B^2-4 A C=0$, it's a parabola.
Hyperbola
General equation:
$$ \frac{(x-h)^2}{a^2}-\frac{(y-k)^2}{b^2}=1 $$
A hyperbola consists of two branches.
If $B^2-4 A C>0$, it's a hyperbola.
Special Cases
https://gist.github.com/viadean/a5515c762b1024e489c6313653121b5c
Explanation of the Code: