siteIcon

Tech Novice Tools

JS Grafix Sandbox

burgerIcon
spiral

JSGrafix Sandbox (JSGS)

TNT Spetal

Your browser does not support HTML5 Canvas

Notes:

Take a few sectors, vary their radii in an alternating fashion and automate the process with a loop and you get a bunch of sector-petals...the TNTSpetal!

Features and Usage:

Primary Attributes:

7 parameters:
center(TNTPoint), radiusLargerPetal(double), numPetals(int), fillColor(TNTColor), borderColor(TNTStroke), ratioOfSmallerPetalToLargerPetal(double),rotationInDegrees(double)

The 'ratio' is the fraction of the smallerPetalLength to the largerPetalLength

To Create:

purpleStroke.lineWidth = .5;
var mySectorPetal = new TNTSpetal(origin, 18, 8, yellow, purpleStroke, .5, 0);

To Draw:

mySectorPetal.drawTNTSpetal(context);

Comments:

Remember a 'double' is a real-valued number in the specifications. The 3rd parameter, numPetals, must be 'integer' in nature and greater than zero, otherwise the code won't work. Try it and see!

Even More:

This shape was used by a novice in a clever wallpaper design.