EDITED:  Thanks to the wonderful folk at Desmos, who helped me solve my problem within minutes of tweeting it, I now have fully functional models.  The problem was making the black dotted distance lines only point to the relevant focus/directrix and not both.  Writing lines parametrically – that’s how to impose conditions on when they appear.

I’ve been trying to make some models to show the relationship between the curve, focus and directrix on conic sections, so here is a set of Desmos models that show you the idea behind focus and directrix.  Each one includes sliders to change parameters and the parabolas display the calculations for the distances from curve to focus and directrix.

  1. Parabola (based on y = x2)
  2. Parabola (based on x = y2)
  3. Hyperbola (I’ve also added the asymptotes onto this in the second edit).
  4. Ellipse
  5. Rectangular hyperbola (special case of the hyperbola where the asymptotes are perpendicular)