Package org.joml.sampling
Class SpiralSampling
- java.lang.Object
-
- org.joml.sampling.SpiralSampling
-
public class SpiralSampling extends java.lang.Object
Creates samples on a spiral around a center point.- Author:
- Kai Burjack
-
-
Constructor Summary
Constructors Constructor Description SpiralSampling(long seed)
Create a new instance ofSpiralSampling
and initialize the random number generator with the givenseed
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createEquiAngle(float radius, int numRotations, int numSamples, float jitter, Callback2d callback)
CreatenumSamples
number of samples on a spiral with maximum radiusradius
around the center usingnumRotations
number of rotations along the spiral, and call the givencallback
for each sample generated.void
createEquiAngle(float radius, int numRotations, int numSamples, Callback2d callback)
CreatenumSamples
number of samples on a spiral with maximum radiusradius
around the center usingnumRotations
number of rotations along the spiral, and call the givencallback
for each sample generated.
-
-
-
Constructor Detail
-
SpiralSampling
public SpiralSampling(long seed)
Create a new instance ofSpiralSampling
and initialize the random number generator with the givenseed
.- Parameters:
seed
- the seed to initialize the random number generator with
-
-
Method Detail
-
createEquiAngle
public void createEquiAngle(float radius, int numRotations, int numSamples, Callback2d callback)
CreatenumSamples
number of samples on a spiral with maximum radiusradius
around the center usingnumRotations
number of rotations along the spiral, and call the givencallback
for each sample generated.The generated sample points are distributed with equal angle differences around the spiral, so they concentrate towards the center.
- Parameters:
radius
- the maximum radius of the spiralnumRotations
- the number of rotations of the spiralnumSamples
- the number of samples to generatecallback
- will be called for each sample generated
-
createEquiAngle
public void createEquiAngle(float radius, int numRotations, int numSamples, float jitter, Callback2d callback)
CreatenumSamples
number of samples on a spiral with maximum radiusradius
around the center usingnumRotations
number of rotations along the spiral, and call the givencallback
for each sample generated.The generated sample points are distributed with equal angle differences around the spiral, so they concentrate towards the center.
Additionally, the radius of each sample point is jittered by the given
jitter
factor.- Parameters:
radius
- the maximum radius of the spiralnumRotations
- the number of rotations of the spiralnumSamples
- the number of samples to generatejitter
- the factor by which the radius of each sample point is jittered. Possible values are[0..1]
callback
- will be called for each sample generated
-
-