module:extras/starpolygon
### module:extras/starpolygon()
The extras/starpolygon.js
module.
To import all symbols in this module, either of the following can be used:
import * from "extras/starpolygon.js"; // -- or -- import * as CustomModuleName from "extras/starpolygon.js";
Methods
- starPolygon
Generates a star polygon{points/jump}
.
### (static) module:extras/starpolygon.starPolygon(x, y, radius, points, jump, [phaseInDegrees])
Generates a star polygon {points/jump}
.
Parameters
x
(Type: number)
X coordinate of the star polygon’s center.y
(Type: number)
Y coordinate of the star polygon’s center.radius
(Type: number)
Radius of the star polygon; that is, the distance from the center to each of its points.points
(Type: number)
Number of points in the star polygon. Must be an integer 2 or greater.jump
(Type: number)
Number of points in the underlying polygon to skip when connecting points with straight line segments to generate the star polygon. Must be an integer 1 or greater.phaseInDegrees
(Type: number) (optional)
Angle, in degrees, of the first point in the star polygon. If null, undefined, or omitted, the default is 0.
Return Value
Array of points (two-element arrays) making up the star polygon. The first number of each point is the X coordinate, and the second the Y coordinate. (Type: Array.<Array.<number»)