diff --git a/js/Random.js b/js/Random.js index 567ab7a..04bd383 100644 --- a/js/Random.js +++ b/js/Random.js @@ -9,37 +9,41 @@ define( function( require ) { 'use strict'; // modules - var inherit = require( 'PHET_CORE/inherit' ); var Util = require( 'DOT/Util' ); + var dot = require( 'DOT/dot' ); - function Random() { - } + dot.Random = function Random() { + }; + var Random = dot.Random; - return inherit( Object, Random, - { - nextBoolean: function() { - return Math.random() >= 0.5; - }, + Random.prototype = { - nextInt: function( n ) { - var value = Math.random() * n; - return value | 0; // convert to int - }, + constructor: Random, - nextDouble: function() { - return Math.random(); - }, + nextBoolean: function() { + return Math.random() >= 0.5; + }, - /** - * @public - * @returns {number} - */ - nextGaussian: function() { - // random gaussian with mean = 0 and standard deviation = 1 - return Util.boxMullerTransform( 0, 1 ); - } + nextInt: function( n ) { + var value = Math.random() * n; + return value | 0; // convert to int + }, - } ); + nextDouble: function() { + return Math.random(); + }, + /** + * @public + * @returns {number} + */ + nextGaussian: function() { + // random gaussian with mean = 0 and standard deviation = 1 + return Util.boxMullerTransform( 0, 1 ); + } + + }; + + return Random; } ); \ No newline at end of file diff --git a/js/main.js b/js/main.js index 5b469b3..e752f36 100644 --- a/js/main.js +++ b/js/main.js @@ -21,6 +21,7 @@ define( [ 'DOT/Plane3', 'DOT/QRDecomposition', 'DOT/Quaternion', + 'DOT/Random', 'DOT/Ray2', 'DOT/Ray3', 'DOT/Rectangle',