org.vormplus.shapeLib.polygons
Class RegularPolygon

java.lang.Object
  extended by org.vormplus.shapeLib.BasicShape
      extended by org.vormplus.shapeLib.polygons.RegularPolygon
Direct Known Subclasses:
Decagon, Dodecagon, Hendecagon, Heptagon, Hexadecagon, Hexagon, Icosagon, Octagon, Pentadecagon, Pentagon, Tetradecagon, Triangle, Tridecagon

public class RegularPolygon
extends BasicShape


Constructor Summary
RegularPolygon(processing.core.PApplet _p)
           
 
Method Summary
 float area(int numVertices, float radius)
          Function to calculate the area of the regular polygon.
 float externalAngle(int numVertices)
          Function to calculate the external angle of the regular polygon
 float internalAngle(int numVertices)
          Function to calculate the internal angle of the regular polygon
 float perimeter(processing.core.PVector[] vertices)
          Function to calculate the internal angle of the regular polygon
 void render(processing.core.PVector[] vertices)
          Renders the Polygon to the screen.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularPolygon

public RegularPolygon(processing.core.PApplet _p)
Method Detail

render

public void render(processing.core.PVector[] vertices)
Renders the Polygon to the screen.


area

public float area(int numVertices,
                  float radius)
Function to calculate the area of the regular polygon. More info about calculating the area of regular polygons can be found over here: http://www.mathopenref.com/polygonregulararea.html


perimeter

public float perimeter(processing.core.PVector[] vertices)
Function to calculate the internal angle of the regular polygon


internalAngle

public float internalAngle(int numVertices)
Function to calculate the internal angle of the regular polygon


externalAngle

public float externalAngle(int numVertices)
Function to calculate the external angle of the regular polygon