Package org.hipparchus.random
Class UnitSphereRandomVectorGenerator
java.lang.Object
org.hipparchus.random.UnitSphereRandomVectorGenerator
- All Implemented Interfaces:
RandomVectorGenerator
Generate random vectors isotropically located on the surface of a sphere.
-
Constructor Summary
ConstructorDescriptionUnitSphereRandomVectorGenerator
(int dimension) Create an object that will use a default RNG (MersenneTwister
), in order to generate the individual components.UnitSphereRandomVectorGenerator
(int dimension, RandomGenerator rand) Simple constructor. -
Method Summary
-
Constructor Details
-
UnitSphereRandomVectorGenerator
Simple constructor.- Parameters:
dimension
- Space dimension.rand
- RNG for the individual components of the vectors.
-
UnitSphereRandomVectorGenerator
public UnitSphereRandomVectorGenerator(int dimension) Create an object that will use a default RNG (MersenneTwister
), in order to generate the individual components.- Parameters:
dimension
- Space dimension.
-
-
Method Details
-
nextVector
public double[] nextVector()Generate a random vector.- Specified by:
nextVector
in interfaceRandomVectorGenerator
- Returns:
- a random vector as an array of double.
-