Your browser does not support HTML5 Canvas

Notes:

Put a bunch of TNTArcs in a loop and you have a WIFI-type symbol staring you in the face. Check it out!

TNTSonarBeams Features and Usage:
Primary Attributes:

3 Parameters:

  • arc0: the initial smaller arc, a TNTArc
  • largestRadius: a positive real number
  • numberOfSteps: positive integer
To Create:

The examples above were created by:

var center = origin; //from graphics library
var radius = 5;
var theta0 = 30;
var thetaf = 120;

var myArc = new TNTArc(center, radius, theta0, thetaf, redStroke);
var rf = 15;
var numBeams = 8;
var mySonarBeams = new TNTSonarBeams(myArc, rf, numBeams);
mySonarBeams.showCenter = true;
mySonarBeams.drawTNTSonarBeams(context);

center = new TNTPoint(-5, -5);
theta0 = 0;
thetaf = 360;
radius = 1;
myArc = new TNTArc(center, radius, theta0, thetaf, blueStroke);
rf = 5;
numBeams = 10;
mySonarBeams = new TNTSonarBeams(myArc, rf, numBeams);
mySonarBeams.showCenter = false;
mySonarBeams.drawTNTSonarBeams(context);
                                    
To Draw: mySonarBeams.drawTNTSonarBeams(context);