Home

<HTML>
<HEAD>
</HEAD>
<BODY onLoad="CreateCircleCurve()">
<SCRIPT type="text/javascript">
// written by: Crailin Mogged //
document.write('<div  id="backPage"> </div>'); 
var Ypos = new Array();
var expPatt = new Array();
var sides;
var expPattLayer = 1;
var cnt;
var X = 1;
var Y = 1;
var tYHeight;
var bYHeight;
var bPatt;
var tPatt;

sides = 128;


function CreateCircleCurve()
{
   expPattLayer = 1;
   X = 1;
   Y = 1;
   Ypos[0] = 1;
   Ypos[sides] = 0;
   while (expPattLayer != sides)
   {
      DoubleSquares();
      MakeExpPatt();
      GetYPositions();
   }
   MirrorCurve();
   
   var xdiam = 168;
   var ydiam = 84;
   var xAxis;
   var yAxis;
   
   for (var i=0; i < sides/2; i++)
   {
      xAxis = 220+Ypos[(i+0)*16%(sides*4)]*xdiam;
      yAxis = 220+Ypos[(sides+i*16)%(sides*4)]*ydiam;
      document.getElementById('backPage').innerHTML = document.getElementById('backPage').innerHTML+'<div id="dot'+[i]+'" style="LEFT:'+xAxis+'px; WIDTH:3px; CLIP: rect(0px 3px 3px 0px); POSITION: absolute; TOP:'+yAxis+'px; HEIGHT: 10px; BACKGROUND-COLOR: #000000"> </div>';
   }
   document.getElementById('backPage').innerHTML = document.getElementById('backPage').innerHTML+Ypos[sides*2-1];
}

function DoubleSquares()
{
   Y = (Math.sqrt(X * 2) - 1)  *  (1 / Y);
   X = 1 - ((1 - Y) / 2 + Y) * ((1 - Y) / 2) * 2;
}


   // Place numbers into an array:
   // if inputs = 8,8 then array = [8*9*10*11*12*13*14*15]
   // if inputs = 8,4 then array = [*4***5***6***7*]
   // if inputs = 8,2 then array = [***2*******3***]
   //
   // if inputs = 4,4 then array = [4*5*6*7]
   // if inputs = 4,2 then array = [*2***3*]
   //
   //
   // if inputs = x,y then x must be >= y
   // the inputs must be a product of any exponent of 2

function MakeExpPatt()
{
   cnt = 0;
   expPatt[cnt+expPattLayer] = sides / (expPattLayer + expPattLayer);
   while(expPatt[cnt+expPattLayer] + sides / expPattLayer < sides)
   {
      cnt++;
      expPatt[cnt+expPattLayer] = expPatt[cnt+expPattLayer-1] + sides / expPattLayer;
   }
   expPattLayer = expPattLayer * 2;
}

function GetYPositions()
{
   cnt = 0;
   while (cnt != expPattLayer)
   {
      cnt++;
      bPatt = cnt * (sides / (expPattLayer / 2));
      tPatt = (cnt - 1) * (sides / (expPattLayer / 2));
      tYHeight = Ypos[tPatt] - Ypos[sides - tPatt] * Y;
      bYHeight = Ypos[bPatt] + Ypos[sides - bPatt] * Y;
      Ypos[expPatt[cnt-1+expPattLayer / 2]] = (tYHeight - bYHeight) / 2 + bYHeight;
   }
}
function MirrorCurve()
{
   cnt = 0;
   while (cnt != sides)
   {
      cnt++;
      Ypos[sides+cnt] = -Ypos[sides - cnt];
      Ypos[sides * 2 + cnt] = -Ypos[cnt];
      Ypos[sides * 3 + cnt] = Ypos[sides - cnt];
   }
}
</SCRIPT>
</BODY>
</HTML>