uniform

fun Box.uniform(random: Random = Random.Default): Vector3(source)

Generates a uniformly distributed random point inside the Box.

Return

A Vector3 representing a random point within the Box.

Parameters

random

An optional random number generator to use. Defaults to Random.Default.


fun Circle.uniform(random: Random = Random.Default): Vector2(source)

Generates a uniformly distributed random point within the Circle.

Return

A Vector2 representing a random point within the Circle.

Parameters

random

An optional random number generator to use. Defaults to Random.Default.


fun Rectangle.uniform(random: Random = Random.Default): Vector2(source)

Generates a uniformly distributed random point within the Rectangle.

Return

A Vector2 representing a random point within the Rectangle.

Parameters

random

An optional random number generator to use. Defaults to Random.Default.


fun List<Triangle>.uniform(count: Int, random: Random = Random.Default): List<Vector2>(source)

Generates a list of 2D points distributed uniformly over a collection of triangles.

Return

A list of uniformly distributed 2D points over the triangles.

Parameters

count

The number of random points to generate.

random

An optional random number generator to use. Defaults to Random.Default.


fun Triangle.uniform(random: Random = Random.Default): Vector2(source)

Generates a uniformly distributed random point within the Triangle.

Return

A Vector2 representing a random point within the Triangle.

Parameters

random

An optional random number generator to use. Defaults to Random.Default.