Outer radius. Maximum radius of a spike to origin
Number of points in the starburst. Defaults to five, which produces a typical star
Optional
innerRadius: numberInner radius. A proportionally smaller inner radius makes for sharper spikes. If unspecified, 50% of the outer radius is used.
Origin, or { x:0, y:0 }
by default.
Optional
opts: { initialAngleRadian?: number }Options
const points = starburst(4, 100, 200);
Drawing.connectedPoints(ctx, pts, {loop: true, fillStyle: `orange`, strokeStyle: `red`});
Options:
-Math.PI/2
default.
Generates a starburst shape, returning an array of points. By default, initial point is top and horizontally-centred.
points
of two produces a lozenge shape.points
of three produces a triangle shape.points
of five is the familiar 'star' shape.Note that the path will need to be closed back to the first point to enclose the shape.