Package org.joml.sampling
Class SpiralSampling
java.lang.Object
org.joml.sampling.SpiralSampling
Creates samples on a spiral around a center point.
- Author:
- Kai Burjack
-
Constructor Summary
ConstructorsConstructorDescriptionSpiralSampling(long seed) Create a new instance ofSpiralSamplingand initialize the random number generator with the givenseed. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateEquiAngle(float radius, int numRotations, int numSamples, float jitter, Callback2d callback) CreatenumSamplesnumber of samples on a spiral with maximum radiusradiusaround the center usingnumRotationsnumber of rotations along the spiral, and call the givencallbackfor each sample generated.voidcreateEquiAngle(float radius, int numRotations, int numSamples, Callback2d callback) CreatenumSamplesnumber of samples on a spiral with maximum radiusradiusaround the center usingnumRotationsnumber of rotations along the spiral, and call the givencallbackfor each sample generated.
-
Constructor Details
-
SpiralSampling
public SpiralSampling(long seed) Create a new instance ofSpiralSamplingand initialize the random number generator with the givenseed.- Parameters:
seed- the seed to initialize the random number generator with
-
-
Method Details
-
createEquiAngle
CreatenumSamplesnumber of samples on a spiral with maximum radiusradiusaround the center usingnumRotationsnumber of rotations along the spiral, and call the givencallbackfor 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) CreatenumSamplesnumber of samples on a spiral with maximum radiusradiusaround the center usingnumRotationsnumber of rotations along the spiral, and call the givencallbackfor 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
jitterfactor.- 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
-