User Guide

327
ADOBE AFTER EFFECTS 5.0
User Guide
Random number methods
Number random() The resulting value is a random number between 0 and 1.
Number random(max) {max is a number} The resulting value is a number between 0 and
max, and is the same dimension as max.
Number random(min, max) {min and max are numbers} The resulting value is a number
between min and max.
Array random(max_arr) {max_arr is an array} The resulting value is an array with the
same dimension as max_arr, with each component ranging between 0 and max_arr.
Array random(min_arr, max_arr) {min_arr and max_arr are arrays} The resulting value
is an array with the same dimension as min_arr and max_arr, with each component
ranging between min_arr and max_arr. For example, the expression “random([100, 200],
[300, 400])” returns an array whose first value is between 100 and 300, and whose second
value is between 200 and 400. If the two input dimensions don’t match, the shorter one is
filled out with zeros.
Number gauss_random() The resulting value is a random number between 0 and 1. The
results have a bell-shaped distribution. About 90% of the results are between 0 and 1, and
the remaining 10% are beyond the edges.
Number gauss_random(max) {max is a number} The resulting value is a random number
between 0 and max. The results have a bell-shaped distribution. About 90% of the results
are in the 0 to max range, and the remaining 10% are beyond the edges.
Number gauss_random(min, max) {min and max are numbers} The resulting value is a
random number between min and max. The results have a bell-shaped distribution. About
90% of the results are in the min to max range, and the remaining 10% are beyond the
edges.
Array gauss_random(max_arr) {max_arr is an array} The resulting value is an array with
the same dimension as max_arr, with 90% of the results ranging between 0 and max_arr
and the remaining 10% beyond the edges. The results have a bell-shaped distribution.
Array gauss_random(min_arr, max_arr) {min_arr and max_arr are numbers} The
resulting value is an array with the same dimension as max_arr, with each component
ranging between min_arr and max_arr. The results have a bell-shaped distribution. About
90% of the results are in the min_arr to max_arr range, and the remaining 10% are beyond
the edges.
UG.book Page 327 Wednesday, February 21, 2001 12:05 PM