RegularPolygon

Element

A regular polygon is a polygon that is direct equiangular (all angles are equal in measure) and equilateral (all sides have the same length). It needs two points which define the base line and the number of vertices, or a set of points.

Usage (signatures)
board.create('regularpolygon', [p1, p2, n]);

The constructed regular polygon has n vertices and the base line defined by p1 and p2.

Parameters
Name Type Description
p1 PointLike
p2 PointLike
n NumberLike
Examples

Regular pentagon

var p1 = board.create('point', [0.0, 2.0]);
var p2 = board.create('point', [2.0, 1.0]);

var pol = board.create('regularpolygon', [p1, p2, 5]);

Equilateral triangle (regular triangle)

var p1 = board.create('point', [0.0, 2.0]);
var p2 = board.create('point', [4.0,4.0]);
var p3 = board.create('point', [2.0,0.0]);

var pol = board.create('regularpolygon', [p1, p2, p3]);
Attributes

Own

borders

Description

Attributes for the polygon border lines.

Type
Line
Overrides
JXG.Polygon#borders
Source
options.js, line 8662

hasInnerPoints

Description

If true, moving the mouse over inner points triggers hasPoint.

Type
Boolean
Default Value
false
See
Source
options.js, line 8637

label

Description

Attributes for the polygon label.

Type
Label
Source
options.js, line 8695

vertices

Description

Attributes for the polygon vertices.

Type
Point
Overrides
JXG.Polygon#vertices
Source
options.js, line 8680

withLines

Description

Is the polygon bordered by lines?

Type
Boolean
Default Value
true
Source
options.js, line 8652

Inherited

Members

Own

none

Inherited

Methods

Own

none

Inherited

Events

Own

none

Inherited

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Exception

Details

Type
Polygon
Source
base/polygon.js, line 1297

Extends