org.vormplus.shapeLib.polygons
Class Decagon

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

public class Decagon
extends RegularPolygon

Create a Decagon object. This class extends the BasicShape class. References ----------------- http://en.wikipedia.org/wiki/Decagon http://www.mathopenref.com/decagon.html

Author:
Jan Vantomme

Field Summary
 float radius
           
 processing.core.PVector[] vertices
           
 
Constructor Summary
Decagon(processing.core.PApplet _p)
          Creates a Decagon object
 
Method Summary
 float area()
          Returns the area of the Decagon.
 float externalAngle()
          Returns the external angle of the Decagon.
 float internalAngle()
          Returns the internal angle of the Decagon.
 float perimeter()
          Returns the perimeter of the Decagon.
 void render()
          Renders the Decagon to the screen.
 Decagon setRadius(float r)
          Sets the radius for the Decagon.
 
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

Decagon

public Decagon(processing.core.PApplet _p)
Creates a Decagon object

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

setRadius

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

Parameters:
r - Radius for the Decagon.

render

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


area

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

Returns:
float: Area of the Decagon.

perimeter

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

Returns:
float: Perimeter of the Decagon.

internalAngle

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

Returns:
float: Internal angle of the Decagon.

externalAngle

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

Returns:
float: External angle of the Decagon.