Your browser does not support HTML5 Canvas

Notes:

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

For more flexibility, you can also try TNTSinusoid.

TNTSine Features and Usage:
Primary Attributes:

5 Parameters:

  • firstCrossingPoint: TNTPoint
  • firstHighPoint: 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 firstCross = new TNTPoint(0, 0);
var firstHigh = new TNTPoint(10, 5);
var xLeft = -15;
var xRight = 20;
darkGrayStroke.setStrokeLineWidth(2);
var mySine = new TNTSine(firstCross, firstHigh, xLeft, xRight, darkGrayStroke);
mySine.drawTNTSine(context);
                                    
To Draw:
mySine.drawTNTSine(context);
Comments:

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