Your browser does not support HTML5 Canvas

Notes:

A TNTRegTrapezoid is a quadrilateral with exactly 2 parallel sides; the other 2 sides have equal length.

TNTRegTrapezoid Features and Usage:
Primary Attributes:

7 Parameters:

  • center: TNTPoint
  • h: a 'double:' the distance between the parallel sides (often described as 'height')
  • b1, b2: the 'base' lengths (the parallel sides) as 'doubles'
  • fillColor: TNTColor as fcolr
  • stroke: a TNTStroke: to set the border color
  • rotn: a 'double' that rotates the shape about its center. rotn > 0 ==> counter-clockwise; rotn < 0 ==> clockwise
To Create:

The 'pink trap' example above was created by:

var center = new TNTPoint(-1, -5);
var h = 8;
var b1 = 6; 
var b2 = 10;
var fcolr = pink;
var stroke = purpleStroke;
var rotn = 30;
var myTrap = new TNTRegTrapezoid(center, h, b1, b2, fcolr, stroke, rotn);
myTrap.showCenter = true;
myTrap.drawTNTRegTrapezoid(context);
                                    
To Draw:
myTrap.drawTNTRegTrapezoid(context);
Comments:

Notice we used the 'showCenter' property to display the location of the trapezoid's center.

Even More: