Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!

Cardioid

By: Matthen on Nov 16th, 2012  |  syntax: None  |  size: 0.71 KB  |  views: 277  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. d = 6 Pi/99;
  2. Manipulate[
  3.  Graphics[{
  4.    {
  5.     If[4 Pi >= s > 2 Pi,
  6.      {
  7.       Darker@Red,
  8.       Table[
  9.        Block[{p}, p = {Sin[t], Cos[t]}; Circle[p, Norm[{0, 1} - p]]]
  10.        , {t, 2 Pi, Max[2 Pi + 0.01, s], d}]
  11.       }
  12.      ,
  13.      If[4 Pi < s,
  14.       {
  15.        Darker@Red,
  16.        Table[
  17.         Block[{p}, p = {Sin[t], Cos[t]}; Circle[p, Norm[{0, 1} - p]]]
  18.         , {t, s, 6 Pi, d}]
  19.        }
  20.       ,
  21.       {}
  22.       ]
  23.      ],
  24.     Thickness[0.01],
  25.     Circle[{0, 0}, 1],
  26.     Circle[{Sin[s], Cos[s]}, Norm[{0, 1} - {Sin[s], Cos[s]}]]
  27.     },
  28.    Darker@Red, PointSize[Large], Point[{Sin[s], Cos[s]}],
  29.    Line[{{0, 1}, {Sin[s], Cos[s]}}]
  30.    }, PlotRange -> 3.1, ImageSize -> 220]
  31.  , {s, 0, 6 Pi, d}]