Your browser does not support HTML5 Canvas

Notes:

A fairly complicated shape that can represent a butterfly...and more!

r = a*cos(b*sin(θ)) * (c + cos(θ))
                        
TNTButterfly Features and Usage:
Primary Attributes:

7 Parameters:

  • center: TNTPoint
  • a: a real number (known as a 'double' in code)
  • b: a real number (known as a 'double' in code)
  • c: a real number (known as a 'double' in code)
  • fillColor: TNTColor as fcolr
  • borderStroke: a TNTStroke
  • 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:

var center = origin.translate(0, 5);
var myButterfly = new TNTButterfly(center, 5, 4, 3, yellow, orangeStroke, -90);
myButterfly.drawTNTButterfly(context);
                                    
To Draw: myButterfly.drawTNTButterfly(context);