rUniformSegment

rUniformSegment(*args)

Realization of a uniform distribution over a segment.

Parameters:
asequence of float, in \Rset^n

The first vertex of the segment.

bsequence of float, in \Rset^n

The second vertex of the segment.

sizeint

The number of realizations to generate.

Returns:
realizationsfloat or sequence of float

The realizations of the distribution.

Notes

This method samples the barycentric coordinates, allowing to work in any dimension.

Examples

>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> a = [1, 5]
>>> b = [2, 3]
>>> r = ot.DistFunc.rUniformSegment(a, b)
>>> r = ot.DistFunc.rUniformSegment(a, b, 10)