withRandomDirection

Returns a vector of same length and a random direction.

Parameters

rng

Random number generator to use (MathUtils.random by default)