Class: BoxSpiralElement

BoxSpiralElement(g, center, options)

Define the BoxSpiral Element. The BoxSpiral element is a square spiral which is used in several tangles. Its size and direction of rotation (cw or ccw) can be specified in the options. The spiral can be made to fit any quarilateral; it need not be limited to a square.

Constructor

new BoxSpiralElement(g, center, options)

Create a box spiral element.

Parameters:
Name Type Description
g p5.Graphics

The graphics buffer on which to draw.

center Point

The center of the spiral.

options BoxSpiralElementOptions

The options list.

Source:

Methods

(static) newFromCoordinates(g, nw, ne, se, sw, options) → {BoxSpiralElement}

Alternate BoxSpiralElement constructor using corner coordinates instead of center and size.

Parameters:
Name Type Description
g p5.Graphics

The graphics buffer on which to draw.g

nw Point

The northwest corner of the quadrilateral.

ne Point

The northeast corner of the quadrilateral.

se Point

The southeast corner of the quadrilateral.

sw Point

The southwest corner of the quadrilateral.

options BoxSpiralElementOptions

The options list.

Source:
Returns:
Type
BoxSpiralElement

draw()

Draw the BoxSpiralElement onto the graphics buffer.

Source: