siteIcon

Tech Novice Tools

JS Grafix Sandbox

burgerIcon
spiral

JSGrafix Sandbox (JSGS)

TNT Square

Your browser does not support HTML5 Canvas

Notes:

Need a square? We're on it! Just tell us it's center (a TNTPoint), it's side-length, s, a fill color (fcolr, TNTColor) and a stroke (TNTStroke) and we'll dish one up. We can even give it a rotation (rotn in degrees) if you'd like!

Features and Usage:

Primary Attributes:

5 Parameters:
center(TNTPoint), sideLength(double), fillColor(TNTColor), borderColor(TNTStroke), rotationDeg(double, about it's center; + angle, clockwise, - angle, counter-clockwise)

To Create:

var theCenter = new TNTPoint(2, 5);
var side = 10;
var mySquare = new TNTSquare(theCenter, side, medGreen, blackStroke, -20);
mySquare.showCenter = true;
mySquare.showPoints = true;

To Draw:

mySquare.drawTNTSquare(context);

Comments:

See it's cousin, TNTTwoTonedSquare

This shape, when tiled in a plane, can create some interesting optical illusions.