ActionScript 3 Working with Geometry The value of a circle in degrees and radians


Example

  • A whole circle is 360 degrees or Math.PI * 2 radians.
  • Half of those values follows to be 180 degrees or Math.PI radians.
  • A quarter is then 90 degrees or Math.PI / 2 radians.

To get a segment as a percentage of a whole circle in radians:

function getSegment(percent:Number):Number {
    return Math.PI * 2 * percent;
}

var tenth:Number = getSegment(0.1); // One tenth of a circle in radians.