Your browser does not support HTML5 Canvas

Notes:

A mathematical shape with a radius that varies with angle: another 'polar coordinate' graph with equation:

r = k*θ/π
                        

If you want to see it animated, we've got that for you too!

TNTSpiral Features and Usage:
Primary Attributes:

6 Parameters:

  • center: TNTPoint
  • k: a real number
  • spiralStroke: a TNTStroke: to set the spiral color as well as its thickness
  • rev: the number of revolutions
  • direction: positive or negative integer
  • rotn: a 'double' that rotates the shape about its center. rotn > 0 ==> counter-clockwise; rotn < 0 ==> clockwise
To Create:

The example above was created by:

blackStroke.lineWidth = 1;
var mySpiral = new TNTSpiral(origin, 1, blackStroke, 10, 1, 90);
mySpiral.drawTNTSpiral(context);
                                    
To Draw:
mySpiral.drawTNTSpiral(context);
Comments:
  • The smaller the 'k', the tighter the spiral
  • 'rev' is the number of complete revolutions
  • if direction ≥ 0, ccw; if direction ≤ 0
  • The spiral gets its color from a TNTStroke, not a fill color