Go to: Synopsis. Return value. Related. MEL examples.
sphrand [string] float|vector
sphrand is NOT undoable, NOT queryable, and NOT editable.
This command generates random vectors evenly distributed inside a sphere of the specified radius. If a vector argument is given, sphrand scales the output by the components of the vector argument. Multiple random number streams:float | or vector |
// This command may be used to generate evenly distributed points on // the surface of a sphere when the output is normalized. $radius = 42; $result=unit(sphrand(1)) * $radius; // Result: <<5.35843, 28.2859, -30.581>> // string $s1 = "stream1"; $result=unit(sphrand($s1,1)) * $radius; // Result: <<5.35843, 28.2859, -30.581>> //