Packagegraphics.geom
Classpublic final class RegularPolygon
InheritanceRegularPolygon Inheritance Object

Tool class to manipulates and transforms the regular polygons.



Public Methods
 MethodDefined By
  
apothemByRadius(radius:Number, sides:uint):Number
[static] Determinates the size of the line segment from the center of a regular polygon to the midpoint of a side.
RegularPolygon
  
apothemBySide(side:Number, sides:uint):Number
[static] Determinates the size of the line segment from the center of a regular polygon to the midpoint of a side.
RegularPolygon
  
areaByApothem(apothem:Number, sides:uint):Number
[static] Calculates the area of the hexagon with the specified apothem length.
RegularPolygon
  
areaByApothemAndPerimeter(apothem:Number, perimeter:Number):Number
[static] Calculates the area of the hexagon with the specified apothem and perimeter length.
RegularPolygon
  
areaByRadius(radius:Number, sides:uint):Number
[static] Calculates the area of the hexagon with the specified radius length.
RegularPolygon
  
areaBySide(side:Number, sides:uint):Number
[static] Calculates the area of the hexagon with the specified side size.
RegularPolygon
  
centralAngle(sides:uint, degrees:Boolean = false):Number
[static] Calculates the central angle of the specified regular polygon.
RegularPolygon
  
perimeter(side:Number, sides:uint):Number
[static] For regular polygons, where all the sides are the same length, the perimeter is n times the length of any side, where n is the number of sides.
RegularPolygon
  
radiusByApothem(apothem:Number, sides:uint):Number
[static] Determinates the radius of the regular polygon with the specified apothem.
RegularPolygon
  
radiusBySide(side:Number, sides:uint):Number
[static] Determinates the radius of the regular polygon with the specified side length.
RegularPolygon
Method Detail
apothemByRadius()method
public static function apothemByRadius(radius:Number, sides:uint):Number

Determinates the size of the line segment from the center of a regular polygon to the midpoint of a side. By definition, all sides of a regular polygon are equal in length. If you know the length of one of the sides, the apothem length is given by the formula: s/(2an(PI/n)) where s is the length of any side, n is the number of sides, PI approximately Math.PI, tan is the tangent function calculated in radians

Parameters

radius:Number — The length of the radius of the polygon.
 
sides:uint — The number of sides.

Returns
Number — The apothem size of the regular polygon.
apothemBySide()method 
public static function apothemBySide(side:Number, sides:uint):Number

Determinates the size of the line segment from the center of a regular polygon to the midpoint of a side. By definition, all sides of a regular polygon are equal in length. If you know the length of one of the sides, the apothem length is given by the formula: s/(2an(PI/n)) where s is the length of any side, n is the number of sides, PI approximately Math.PI, tan is the tangent function calculated in radians

Parameters

side:Number — The length of any side.
 
sides:uint — The number of sides.

Returns
Number — The apothem size of the regular polygon.
areaByApothem()method 
public static function areaByApothem(apothem:Number, sides:uint):Number

Calculates the area of the hexagon with the specified apothem length.

Parameters

apothem:Number — The size of the line segment from the center of a regular polygon to the midpoint of a side.
 
sides:uint — The number of sides.

Returns
Number — The area of the specified regular polygon.
areaByApothemAndPerimeter()method 
public static function areaByApothemAndPerimeter(apothem:Number, perimeter:Number):Number

Calculates the area of the hexagon with the specified apothem and perimeter length.

Parameters

apothem:Number — The size of the line segment from the center of a regular polygon to the midpoint of a side.
 
perimeter:Number — The perimeter length.

Returns
Number — The area of the specified regular polygon.
areaByRadius()method 
public static function areaByRadius(radius:Number, sides:uint):Number

Calculates the area of the hexagon with the specified radius length.

Parameters

radius:Number — The length of the radius of the polygon.
 
sides:uint — The number of sides.

Returns
Number — The area of the specified regular polygon.
areaBySide()method 
public static function areaBySide(side:Number, sides:uint):Number

Calculates the area of the hexagon with the specified side size.

Parameters

side:Number — The length of any side.
 
sides:uint — The number of sides.

Returns
Number — The area of the specified regular polygon.
centralAngle()method 
public static function centralAngle(sides:uint, degrees:Boolean = false):Number

Calculates the central angle of the specified regular polygon. The central angle is the angle made at the center of the polygon by any two adjacent vertices of the polygon.

Parameters

sides:uint — The number of sides
 
degrees:Boolean (default = false) — Indicates if the angle is in degrees or in radians (by default in radians).

Returns
Number
perimeter()method 
public static function perimeter(side:Number, sides:uint):Number

For regular polygons, where all the sides are the same length, the perimeter is n times the length of any side, where n is the number of sides.

Parameters

side:Number — The length of any side.
 
sides:uint — The number of sides.

Returns
Number — The perimeter of the specified regular polygon.
radiusByApothem()method 
public static function radiusByApothem(apothem:Number, sides:uint):Number

Determinates the radius of the regular polygon with the specified apothem.

Parameters

apothem:Number — The size of the line segment from the center of a regular polygon to the midpoint of a side.
 
sides:uint — The number of sides.

Returns
Number — The radius of the regular polygon.
radiusBySide()method 
public static function radiusBySide(side:Number, sides:uint):Number

Determinates the radius of the regular polygon with the specified side length.

Parameters

side:Number — The length of any side.
 
sides:uint — The number of sides.

Returns
Number — The radius of the regular polygon.