Your browser does not support HTML5 Canvas

Notes:

What in the world is a PWave? (Look at the orange shape for a possible hint!) Our lovely shapes come from, once more, parametric equations: (another name hint?!!)

x = a*cos(t), 
y = b*sin(n*t)
                        
TNTPWave Features and Usage:
Primary Attributes:

7 Parameters:

  • center: TNTPoint
  • a: a decimal (known as a 'double' in code)
  • b: another 'double'
  • n: yet another 'double'
  • fillColor: TNTColor (can be null for a framework image)
  • borderStroke: a TNTStroke: to set the border color as well as the thickness of the sides
  • rotationDeg: a 'double' that rotates the image about its center.
    rotn > 0 ==> counter-clockwise; rotn < 0 ==> clockwise
To Create:

The examples above were created by:

var ptA = new TNTPoint(0, 10);
var ptB = new TNTPoint(0, -10);

darkGrayStroke.setStrokeLineWidth(.1);
var propeller = new TNTPWave(origin, 15, 3, 2, orange, darkGrayStroke, 0);
propeller.drawTNTPWave(context);

var crown = new TNTPWave(ptA, 15, 3, 8, gold, darkGrayStroke, 10);
crown.drawTNTPWave(context);

var spring = new TNTPWave(ptB, 2, 4, 8, lightGray, darkGrayStroke, 90);
spring.drawTNTPWave(context);
                                    
To Draw: propeller.drawTNTPWave(context);
Comments:

a, b and n influence the shape of the graph given the parametric definitions above. Experiment! You can do this easily at: Anime-TNTPWave.