Packagegraphics.geom
Classpublic class Hexagon
InheritanceHexagon Inheritance Object
Implements Geometry

A regular hexagon is a six-sided regular polygon.



Public Properties
 PropertyDefined By
  apothem : Number
The apothem distance of the hexagon (height / 2 ).
Hexagon
  height : Number
Determinates the height of the hexagon (2 apothem)
Hexagon
  perimeter : Number
The perimeter size of the hexagon.
Hexagon
  radius : Number
Distance from the center to a vertex.
Hexagon
  side : Number
The size of the sides of the regular hexagon.
Hexagon
  width : Number
Determinates the width of the hexagon (2 radius)
Hexagon
Public Methods
 MethodDefined By
  
Hexagon(radius:Number = 0)
Creates a new Hexagon instance.
Hexagon
  
clone():*
Creates and returns a shallow copy of the object.
Hexagon
  
equals(o:*):Boolean
Compares the specified object with this object for equality.
Hexagon
  
reset():void
Resets all components of the regular hexagon.
Hexagon
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
Hexagon
  
toString(floatCount:uint = 2):String
Returns the String representation of the object.
Hexagon
Public Constants
 ConstantDefined By
  centralAngle : uint
[static] Indicates the central angle value (in degrees) of the hexagon (60°).
Hexagon
  centralAngleRadians : Number
[static] Indicates the central angle value (in radians) of the hexagon (60 Math.PI / 180).
Hexagon
  exteriorAngle : uint = 60
[static] Indicates the exterior angle value (in degrees) of the hexagon (60°).
Hexagon
  exteriorAngleRadians : Number = 1.0471975511965976
[static] Indicates the exterior angle value (in radians) of the hexagon (60 Math.PI / 180).
Hexagon
  interiorAngle : uint = 120
[static] Indicates the interior angle value (in degrees) of the hexagon (120°).
Hexagon
  numDiagonals : uint = 9
[static] The number of distinct diagonals (9) possible from all vertices, in general n (n–3) / 2.
Hexagon
  numSides : uint = 6
[static] The number of sides of the polygon (6).
Hexagon
  numTriangles : uint = 4
[static] The number of triangles (4) created by drawing the diagonals from a given vertex.
Hexagon
  sumInteriorAngle : uint = 720
[static] The sum (in degrees) of all interior angles of the hexagon (720°).
Hexagon
Property Detail
apothemproperty
apothem:Number

The apothem distance of the hexagon (height / 2 ). The distance of the line segment from the center of a regular polygon perpendicular to a side (i.e. when a regular polygon is broken into triangles, the apothem is the height of one of the triangles whose base is a side of the regular polygon).


Implementation
    public function get apothem():Number
    public function set apothem(value:Number):void
heightproperty 
height:Number

Determinates the height of the hexagon (2 apothem)


Implementation
    public function get height():Number
    public function set height(value:Number):void
perimeterproperty 
perimeter:Number

The perimeter size of the hexagon.


Implementation
    public function get perimeter():Number
    public function set perimeter(value:Number):void
radiusproperty 
radius:Number

Distance from the center to a vertex.


Implementation
    public function get radius():Number
    public function set radius(value:Number):void
sideproperty 
side:Number

The size of the sides of the regular hexagon.


Implementation
    public function get side():Number
    public function set side(value:Number):void
widthproperty 
width:Number

Determinates the width of the hexagon (2 radius)


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
Hexagon()Constructor
public function Hexagon(radius:Number = 0)

Creates a new Hexagon instance.

Parameters
radius:Number (default = 0)
Method Detail
clone()method
public function clone():*

Creates and returns a shallow copy of the object.

Returns
* — A new object that is a shallow copy of this instance.
equals()method 
public function equals(o:*):Boolean

Compares the specified object with this object for equality.

Parameters

o:*

Returns
Booleantrue if the the specified object is equal with this object.
reset()method 
public function reset():void

Resets all components of the regular hexagon.

toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString(floatCount:uint = 2):String

Returns the String representation of the object.

Parameters

floatCount:uint (default = 2) — the number of floats of the radius and apothem numeric values in the string representation (default 2).

Returns
String — the String representation of the object.
Constant Detail
centralAngleConstant
public static const centralAngle:uint

Indicates the central angle value (in degrees) of the hexagon (60°).

centralAngleRadiansConstant 
public static const centralAngleRadians:Number

Indicates the central angle value (in radians) of the hexagon (60 Math.PI / 180).

exteriorAngleConstant 
public static const exteriorAngle:uint = 60

Indicates the exterior angle value (in degrees) of the hexagon (60°). To find the exterior angle of a regular hexagon, we use the fact that the exterior angle forms a linear pair with the interior angle, so in general it is given by the formula 180 - interior angle.

exteriorAngleRadiansConstant 
public static const exteriorAngleRadians:Number = 1.0471975511965976

Indicates the exterior angle value (in radians) of the hexagon (60 Math.PI / 180).

interiorAngleConstant 
public static const interiorAngle:uint = 120

Indicates the interior angle value (in degrees) of the hexagon (120°). Like any regular polygon, to find the interior angle we use the formula (180n–360)/n . For a hexagon, n=6.

numDiagonalsConstant 
public static const numDiagonals:uint = 9

The number of distinct diagonals (9) possible from all vertices, in general n (n–3) / 2.

numSidesConstant 
public static const numSides:uint = 6

The number of sides of the polygon (6).

numTrianglesConstant 
public static const numTriangles:uint = 4

The number of triangles (4) created by drawing the diagonals from a given vertex. (In general n–2)

sumInteriorAngleConstant 
public static const sumInteriorAngle:uint = 720

The sum (in degrees) of all interior angles of the hexagon (720°). In general 180(n–2) degrees.