<regularPolygon>
<regularPolygon>
is a Graphical
component that renders a regular polygon on a <graph>
.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
allowDilation = "…" | boolean | "true" "false" |
allowRotation = "…" | boolean | "true" "false" |
allowTranslation = "…" | boolean | "true" "false" |
apothem = "…" | number | |
applyStyleToLabel = "…" | boolean | "true" "false" |
area = "…" | number | |
center = "…" | [ math ] | |
circumradius = "…" | number | |
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
draggable = "…" | boolean | "true" "false" |
filled = "…" | boolean | "true" "false" |
inradius = "…" | number | |
labelIsName = "…" | boolean | "true" "false" |
layer = "…" | integer | |
minShrink = "…" | ||
numSides = "…" | integer | |
numVertices = "…" | integer | |
padZeros = "…" | boolean | "true" "false" |
perimeter = "…" | number | |
radius = "…" | number | |
rigid = "…" | boolean | "true" "false" |
rotateAround = "…" | "centroid" "vertex" "point" | |
rotationCenter = "…" | ||
rotationHandleVertices = "…" | ||
rotationVertex = "…" | ||
showCoordsWhenDragging = "…" | boolean | "true" "false" |
sideLength = "…" | number | |
vertices = "…" | [ math ] | |
verticesDraggable = "…" | boolean | "true" "false" |
Property | Type |
---|---|
$r.allowDilation | boolean |
$r.allowRotation | boolean |
$r.allowTranslation | boolean |
$r.apothem | number |
$r.applyStyleToLabel | boolean |
$r.area | number |
$r.borderStyleDescription | text |
$r.center | [ math ] |
$r.circumradius | number |
$r.disabled | boolean |
$r.displayDecimals | integer |
$r.displayDigits | integer |
$r.displaySmallAsZero | number |
$r.draggable | boolean |
$r.filled | boolean |
$r.fillStyleDescription | text |
$r.fixed | boolean |
$r.fixLocation | boolean |
$r.hidden | boolean |
$r.inradius | number |
$r.label | label |
$r.labelIsName | boolean |
$r.layer | integer |
$r.numDimensions | number |
$r.numSides | integer |
$r.numVertices | integer |
$r.padZeros | boolean |
$r.perimeter | number |
$r.preserveSimilarity | boolean |
$r.radius | number |
$r.rigid | boolean |
$r.showCoordsWhenDragging | boolean |
$r.sideLength | number |
$r.styleDescription | text |
$r.styleDescriptionWithNoun | text |
$r.vertices | [ math ] |
$r.verticesDraggable | boolean |
Examples Page 1
Example: Default <regularPolygon>
The default shape for a <regularPolygon>
without any attributes specified
is a triangle with radius 1 (where radius implies circumradius in this case),
centered at the origin.
Example: <regularPolygon>
with user-specified sides
In this example, the number of sides and side length are specified by the user
with a <mathInput/>
and a <slider/>
component, respectively. These
values are then referenced by the numSides
and sideLength
attributes of
the <regularPolygon>
. Note that the prefill
attributes
are required in this case; the values for these attributes cannot be null.
Example: Filled, colored <regularPolygon>
The filled
attribute renders the polygon with default shading to match the styleNumber
.
Example: Construct a polygon on a given line segment
Two vertices only of a <regularPolygon>
are specified in the vertices
attribute by
referencing the endpoints of a defined <lineSegment>
. Try tinkering with the
number of sides in this example, or dragging the endpoints of the line segment.
Attribute Example: numVertices
The number of vertices of a regular polygon can be specified with the numVertices
attribute.
Attribute Example: numSides
The number of sides of a regular polygon can be specified with the numSides
attribute.
Attribute Example: center
The center of a regular polygon can be specified with the center
attribute.
Note on precedence: the vertices
and center
attributes take precedence over the
following attributes (in the event of overconstraint): radius / circumRadius
,
inRadius / apothem
, sideLength
, perimeter
, and area
.
Attribute Example: vertices
The endpoints of a known side can be specified with the vertices
attribute, and Doenet will construct the resulting regular polygon (given a specified number of sides).
Note on precedence: the vertices
and center
attributes take precedence over the following attributes (in the event of overconstraint): radius / circumRadius
, inRadius / apothem
, sideLength
, perimeter
, and area
.
Attribute Example: radius / circumRadius
The radius
and circumRadius
attributes are an interchangeable way to specify the distance from the center of a regular polygon to any of its vertices. (Note that the vertices
attribute takes precedence in the case of overconstraint.)
Attribute Example: inRadius / apothem
The inRadius
and apothem
attributes are an interchangeable way to specify the distance from the center of a regular polygon to the midpoint of any of its sides. (Note that the vertices
attribute takes precedence in the case of overconstraint.)
Attribute Example: sideLength
The sideLength
attribute can be used to adjust the size of the regular polygon. (Note that the vertices
attribute takes precedence in the case of overconstraint.)
Attribute Example: perimeter
The perimeter
attribute can be used to adjust the size of the regular polygon. (Note that the vertices
attribute takes precedence in the case of overconstraint.)