new RegPolygon(x, y, r, n)
A regular polygon is a polygon that has all of its sides equal in length.
In PhSim, a regular polgon is any object obj
such that the following are true:
this.shape === "regPolygon"
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | x-coordinate of the center |
y |
Number | y-coordinate of the center |
r |
Number | radius of the regular polygon |
n |
Number | sides of the regular polygon |
- Source:
Members
-
cycle :Number
-
The angle of the regular polygon
Type:
- Number
- Source:
-
radius :Number
-
The radius of the regular polygon
Type:
- Number
- Source:
-
shape :Boolean
-
Boolean for indicating a regular polygon
Type:
- Boolean
- Source:
-
sides :Number
-
The number of sides the regular polygon has
Type:
- Number
- Source:
-
x :Number
-
x-coordinate of the center of the regular polygon
Type:
- Number
- Source:
-
y :Number
-
y-coordinate for the center of the regular polygon
Type:
- Number
- Source: