org.vormplus.shapeLib.polygons
Class Dodecagon

java.lang.Object
  extended by org.vormplus.shapeLib.BasicShape
      extended by org.vormplus.shapeLib.polygons.RegularPolygon
          extended by org.vormplus.shapeLib.polygons.Dodecagon

public class Dodecagon
extends RegularPolygon

Create a Dodecagon object, a regular polygon with 12 sides This class extends the BasicShape class. References ----------------- http://en.wikipedia.org/wiki/Dodecagon http://www.mathopenref.com/dodecagon.html

Author:
Jan Vantomme

Field Summary
 float radius
           
 processing.core.PVector[] vertices
           
 
Constructor Summary
Dodecagon(processing.core.PApplet _p)
          Creates a Dodecagon object with a radius of 50.
 
Method Summary
 float area()
          Returns the area of the Dodecagon.
 float externalAngle()
          Returns the external angle of the Dodecagon.
 float internalAngle()
          Returns the internal angle of the Dodecagon.
 float perimeter()
          Returns the perimeter of the Dodecagon.
 void render()
          Renders the Dodecagon to the screen.
 Dodecagon setRadius(float r)
          Sets the radius for the Dodecagon.
 
Methods inherited from class org.vormplus.shapeLib.polygons.RegularPolygon
area, externalAngle, internalAngle, perimeter, render
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

public float radius

vertices

public processing.core.PVector[] vertices
Constructor Detail

Dodecagon

public Dodecagon(processing.core.PApplet _p)
Creates a Dodecagon object with a radius of 50.

Parameters:
_p - Reference to the PApplet object. Normally use 'this'
Method Detail

setRadius

public Dodecagon setRadius(float r)
Sets the radius for the Dodecagon.

Parameters:
r - Radius for the Dodecagon.

render

public void render()
Renders the Dodecagon to the screen.


area

public float area()
Returns the area of the Dodecagon.

Returns:
float: Area of the Dodecagon.

perimeter

public float perimeter()
Returns the perimeter of the Dodecagon.

Returns:
float: Perimeter of the Dodecagon.

internalAngle

public float internalAngle()
Returns the internal angle of the Dodecagon.

Returns:
float: Internal angle of the Dodecagon.

externalAngle

public float externalAngle()
Returns the external angle of the Dodecagon.

Returns:
float: External angle of the Dodecagon.