The ellipse, the hyperbola and a line against them

Find the foci of an ellipse and a hyperbola from the equation, build an ellipse with its centre anywhere, draw the asymptote of a hyperbola and test a line against a parabola.

Guide

An ellipse is the set of points whose distances from two fixed points F and F′ (the foci) add up to 2a. With the centre at the origin its equation is x2a2 + y2b2 = 1, with c2 = a2 − b2 and foci (±c,0). With centre (h,k): (x − h)2a2 + (y − k)2b2 = 1.

A hyperbola is the set of points whose distances from the two foci differ by 2a. Its equation is x2a2 − y2b2 = 1, with c2 = a2 + b2. Careful: in an ellipse c is smaller than a, in a hyperbola larger. Its asymptotes are y = ±ba(x − h) + k.

To test a line against a conic, substitute y from the line into the equation of the conic. Take the discriminant of the quadratic you get: positive, two points of intersection; zero, a tangent; negative, no intersection.