Package org.apache.commons.rng.sampling
Class UnitSphereSampler
java.lang.Object
org.apache.commons.rng.sampling.UnitSphereSampler
public class UnitSphereSampler
extends java.lang.Object
Generate vectors
isotropically located on the surface of a sphere.
Sampling uses:
- Since:
- 1.1
-
Constructor Summary
Constructors Constructor Description UnitSphereSampler(int dimension, UniformRandomProvider rng) -
Method Summary
Modifier and Type Method Description double[]nextVector()
-
Constructor Details
-
UnitSphereSampler
- Parameters:
dimension- Space dimension.rng- Generator for the individual components of the vectors. A shallow copy will be stored in this instance.- Throws:
java.lang.IllegalArgumentException- Ifdimension <= 0
-
-
Method Details
-
nextVector
public double[] nextVector()- Returns:
- a random normalized Cartesian vector.
-