Skip to content

editor / stretchedPolygon

Function: stretchedPolygon() ​

stretchedPolygon(corners, size): readonly Point[]

Defined in: geometry/stretched-polygon.ts:22

Stretched polygon of n corners filling a width × height box from the origin: the unit polygon of rule C for the ratio of the box, each axis scaled to the box, the top-left fixed, so that it touches the four sides, within a rounding error of the box (one unit in the last place: the span of the unit polygon is not an integer) (DERIV-stretched-polygon step 6). Its sides are equal while its corners keep half their regular turn; past that, the limit polygon is stretched. A size of 0 puts every point on the side at 0.

Parameters ​

corners ​

number

number of corners n, an integer from 3 to 12

size ​

Size

width and height of the box, ≥ 0

Returns ​

readonly Point[]

the n vertices in drawing order, clockwise on screen from the right end of the base

Kind ​

geometry

See ​

DERIV-stretched-polygon