randSolid2D

taichi_glsl.randgen.randSolid2D()

Generate a 2-D random unit vector whose length is <= 1.0. The return value is a 2-D vector, whose tip distributed evenly inside a unit circle.

Returns

The return value is computed as:

a = rand() * math.tau
r = sqrt(rand())
return vec(cos(a), sin(a)) * r