Your browser does not support HTML5 Canvas

Notes:

Make some waves with TNTCosine! (Remember: high, cross, low, cross, high?)

For more flexibility, you can also try TNTSinusoid.

TNTSine Features and Usage:
Primary Attributes:

5 Parameters:

  • firstHighPoint: TNTPoint
  • firstLowPoint: TNTPoint
  • xLeft: a real number marking where the wave starts
  • xRight: a real number marking where the wave ends
  • waveStroke: a TNTStroke: to set the wave color as well as its thickness
To Create:

The example above was created by:

var firstHigh = new TNTPoint(0, 10);
var firstLow = new TNTPoint(5, -10);
var xLeft = -15;
var xRight = 15;
redStroke.setStrokeLineWidth(.7);
var myCosine = new TNTCosine(firstHigh, firstLow, xLeft, xRight, redStroke);
myCosine.drawTNTCosine(context);
                                    
To Draw:
myCosine.drawTNTCosine(context);
Comments:

Really thick strokes on these babies can make great hills and valleys!