Your browser does not support HTML5 Canvas

Notes:

A sector is like a slice of pizza: a fraction of a circle, featuring a so-called 'central angle' (in degrees)

This shape gave birth to our wondrous TNTSpetal: a flower with 'sector' petals - get it? SPetal!

TNTSector Features and Usage:
Primary Attributes:

6 Parameters:

  • center: TNTPoint
  • radius: a decimal (known as a 'double' in code)
  • initialAngleDeg: a decimal ('double'). Positive angles are counter-clockwise; negative angles are clockwise.
  • finalAngleDeg: a decimal ('double'). Positive angles are counter-clockwise; negative angles are clockwise.
  • fillColor: TNTColor (can be null for a framework image)
  • borderColor: a TNTStroke: to set the border color as well as the thickness of the sides
To Create:

The example above was created by:

var fallLeafBrown = new TNTColor(151, 85, 
    14, "fallLeafBrown");
var center = new TNTPoint(0, 0);
var radius = 10;
var mySector = new TNTSector(center, radius, 
    30, 120, fallLeafBrown, null);
mySector.drawTNTSector(context);
                                    
To Draw: mySector.drawTNTSector(context);
Comments:

Angles are referenced from the positive x-axis, just as in math class