gaussian

fun gaussian(mean: Double = 0.0, deviation: Double = 1.0, random: Random = Random.Default): Double(source)
fun Double.Companion.gaussian(mean: Double = 0.0, deviation: Double = 1.0, random: Random = Random.Default): Double(source)

Generates a random number following a Gaussian (normal) distribution.

Return

A random number sampled from the specified Gaussian distribution.

Parameters

mean

The mean of the Gaussian distribution. Defaults to 0.0.

deviation

The standard deviation of the Gaussian distribution. Defaults to 1.0.

random

The random number generator to use. Defaults to Random.Default.


fun Vector2.Companion.gaussian(mean: Vector2 = Vector2.ZERO, deviation: Vector2 = Vector2.ONE, random: Random = Random.Default): Vector2(source)

Generates a random 2D vector with components sampled from independent Gaussian (normal) distributions.

Return

A 2D vector with components sampled from their respective Gaussian distributions.

Parameters

mean

The mean vector of the Gaussian distributions for the x and y components. Defaults to Vector2.ZERO.

deviation

The standard deviation vector of the Gaussian distributions for the x and y components. Defaults to Vector2.ONE.

random

The random number generator to use. Defaults to Random.Default.


fun Vector3.Companion.gaussian(mean: Vector3 = Vector3.ZERO, deviation: Vector3 = Vector3.ONE, random: Random = Random.Default): Vector3(source)

Generates a random Vector3 following a Gaussian (normal) distribution.

Return

A random Vector3 sampled from the specified Gaussian distribution.

Parameters

mean

The mean vector for the Gaussian distribution. Defaults to Vector3.ZERO.

deviation

The standard deviation vector for the Gaussian distribution. Defaults to Vector3.ONE.

random

The random number generator to use. Defaults to Random.Default.


fun Vector4.Companion.gaussian(mean: Vector4 = Vector4.ZERO, deviation: Vector4 = Vector4.ONE, random: Random = Random.Default): Vector4(source)

Generates a random Vector4 where each component is sampled independently from a Gaussian (normal) distribution.

Return

A Vector4 where each component is a random number sampled from the specified Gaussian distribution.

Parameters

mean

A Vector4 representing the mean of the distribution for each component. Defaults to Vector4.ZERO.

deviation

A Vector4 representing the standard deviation of the distribution for each component. Defaults to Vector4.ONE.

random

The random number generator to use. Defaults to Random.Default.