Elliptic Pencil

I wanted to play around with generating an “elliptic pencil of circles” starting with the Hermatian matrices. An elliptic pencil of circles are all the circles (or some of them) which all intersect at two specific points. Here is a simple one, where the points of intersection are at (0,1) and (0,-1), or ±i in the complex plane.

You see there is the unit circle, plus the other circles branching off to each side:

The Hermatian matrix template for this particular pencil is elegant:

$\begin{bmatrix} 1 & -n \\ -n & -1 \end{bmatrix}$

where n is the x coordinate of the center of each circle (or the complex number center, not having an imaginary component).

Here is Racket code used to generate the plot:

(require math/array)
(require math/matrix)
(require plot)

(let ([A (array-ref M #[0 0])]
[d (matrix-determinant M)])
(sqrt (/ d (* -1 (* A A))))))

(define (matrix-circle-center M)
(let ([C (array-ref M #[1 0])]
[A (array-ref M #[0 0])])
(/ C (* -1 A))))

(define (circle-isoline x y r c)
(isoline
(lambda (x_ y_) (sqrt (+ (sqr (- x_ x)) (sqr (- y_ y))))) r
#:color c
#:width 2))

(define (elipt-plot-demo)
(plot
(map (lambda (C)
(circle-isoline (real-part (first C))
(imag-part (first C))
(second C)
(list 30 160 210)
))
(map (lambda (M)
(list (matrix-circle-center M)
#:height 400))