PolygonalChain

Element

A polygonal chain is a connected series of line segments (borders). It is determined by

  • a list of points or
  • a list of coordinate arrays or
  • a function returning a list of coordinate arrays.

Each two consecutive points of the list define a line. In JSXGraph, a polygonal chain is simply realized as polygon without the last - closing - point. This may lead to unexpected results. Polygonal chains can be distinguished from polygons by the attribute 'elType' which is 'polygonalchain' for the first and 'polygon' for the latter.

Usage (signatures)
board.create('polygonalchain', [vertices]);
Parameters
Name Type Description
vertices Array

The polygon's vertices.

Example
var attr = {
            snapToGrid: true
        },
        p = [];

	p.push(board.create('point', [-4, 0], attr));
	p.push(board.create('point', [-1, -3], attr));
	p.push(board.create('point', [0, 2], attr));
	p.push(board.create('point', [2, 1], attr));
	p.push(board.create('point', [4, -2], attr));

 var chain = board.create('polygonalchain', p, {borders: {strokeWidth: 3}});

board.create('polygonalchain', [pol, t]);

Additionally, a polygonal chain can be created by providing a polygonal chain and a transformation (or an array of transformations). The result is a polygonal chain which is the transformation of the supplied polygonal chain.

Parameters
Name Type Description
pol PolygonalChain
t Transformation
Attributes

Own

none

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 1412

Extends