Methods
(static) createRandomStipples(numStipples, xScale, yScale, sampler) → {Array.<Stipple>}
Creates an array of randomly placed stipples in a 2D region with lower bounds (0,0) and upper bounds (xScale, yScale).
Parameters:
Name | Type | Default | Description |
---|---|---|---|
numStipples |
the number of Stipple instances to create | ||
xScale |
1 | the upper bound for x coordinates of created Stipple instances | |
yScale |
1 | the upper bound for y coordinates of created Stipple instances | |
sampler |
a callable factory for creating sampling functions. Must have the signature (number, number, ...) => function |
- Source:
Returns:
an array of randomly placed Stipple instances.
- Type
- Array.<Stipple>
position() → {Array.<number>}
The position of this stipple with respect to the dimensions of the DensityFunction2D it was created from.
- Source:
Returns:
the position of this stipple as an array containing its x and y coordinates (i.e. [x,y])
- Type
- Array.<number>
setPosition(x, y)
Sets the position for this stipple based on new x and y coordinates.
Parameters:
Name | Type | Description |
---|---|---|
x |
the new x coordinate of this stipple | |
y |
the new y coordinate of this stipple |
- Source: