### Dupin Cyclide

The Dupin Cyclides can be looked at in various ways. They are the envelope of spheres kissing three other fixed spheres. They are also the envelope of spheres with centres on a conic and touching a sphere. This formulation, and the program, is based upon the fact that every Dupin Cyclide is the inverse of a Torus.

The Dupin Cyclide family of surfaces is a member of a larger group of surfaces referred to as Canal surfaces or Swept surfaces, all of which are envelopes of sweeping objects.

This formula is the inversion of a torus in the x-z plane, with the origin as inversion center.

```      (r1^2 - dy^2 - (dx + r0)^2)*(r1^2 - dy^2 - (dx - r0)^2)*
(x^4+y^4+z^4)+ 2*((r1^2 - dy^2 - (dx + r0)^2 )*
(r1^2 - dy^2 - (dx - r0)^2)* (x^2*y^2+x^2*z^2+y^2*z^2))+
2*ri^2*((-dy^2-dx^2+r1^2+r0^2)* (2*x*dx+2*y*dy-ri^2)-4*dy*r0^2*y)*
(x^2+y^2+z^2)+ 4*ri^4(dx*x+dy*y)*(-ri^2+dy*y+dx*x)+
4*ri^4*r0^2*y^2+ri^8=0
```
Where
dx,dy=Torus displacement.
```    r0=4.9,r1=5,dx=2,dy=0,ri=3  (double crescent)