randNDRange

taichi_glsl.randgen.randNDRange(a, b)

Generate a n-D random vector in a n-D cube. a and b should be n-D vectors. The return value is also a n-D vector, whose i-th component is a random number distributed evenly in range [a[i], b[i]], each componment is generated independently.

Parameters
  • a – Specify the staring point / coordinate of cube.

  • b – Specify the ending point / coordinate of cube.

Returns

The return value is calculated as a + randND((b - a).n) * (b - a).