Circle Packing Animation in GNU Emacs
Here's an implementation of circle packing algorithm by Wang et. el. in Elisp. Front chain is the set of circles on the periphery. These are shown as connected by red line in the animation. (require 'graph-pack) (defstruct point x y r) ;; Define a point (setq p (make-point :x 17 :y 0 :r 16)) ;; Define a list of points (setq points (list p1 p2)) ;; Image is an SVG image. This is used for drawing the animation (optional). (graph-pack points image) Background I don't have access to the research paper. The link to paper in D3js documentation wasn't very helpful either. Hence the code didn't make much sense to me. It only struck me when I saw the following image. Important: My implementation doesn't use scores at each step. On the surface, that doesn't seem to be a drawback though. Code https://github.com/atamariya/tumblesocks/blob/dev/graph-pack.el https://github.com/atamariya/tumblesocks/blob/dev/graph-enclose.el https://github.com/atamariya/tumb