Skip to content

tkz-fn examples

Cassini ovals

Cassini ovals
View TeX code
% !TEX TS-program = lualatex
% cassini.tex -- Cassini ovals: the points M whose distances to the foci
% F(-1,0) and F'(1,0) have a constant product, MF * MF' = b^2.
% One implicit function, several levels c = b^4 (option level):
% two ovals for b < 1, the lemniscate of Bernoulli for b = 1 (red),
% one oval with a "waist" for 1 < b < sqrt 2, a convex oval beyond.
\documentclass[border=12pt]{standalone}
\usepackage{tkz-fn}
\begin{document}
\begin{tikzpicture}
  \tkzFnInit[xmin=-2,xmax=2,ymin=-1.5,ymax=1.5,xstep=.5,ystep=.5]
  \tkzFnGrid
  \tkzFnAxes[ticks=false]
  \foreach \c/\col in {0.3/blue,0.7/teal,1.5/orange,3/violet,6/brown}
    {\tkzFnImplicit[level=\c,thick,\col,samples=200]
       {((x-1)^2+y^2)*((x+1)^2+y^2)}}
  \tkzFnImplicit[very thick,red,samples=200]
    {((x-1)^2+y^2)*((x+1)^2+y^2) = 1}
  \tkzFnDefPointXY(-1,0){F}
  \tkzFnDefPointXY(1,0){F'}
  \tkzFnDrawPoints(F,F')
  \tkzFnLabelPoints[below](F,F')
\end{tikzpicture}
\end{document}