Skip to content

Commit

Permalink
create dotRandom and use instead of phet.joist.random, phetsims/joist…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 22, 2021
1 parent 3c95a29 commit cd673f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/common/RandomUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @author Chris Malley (PixelZoom, Inc.)
*/

import dotRandom from '../../../dot/js/dotRandom.js';
import modelsOfTheHydrogenAtom from '../modelsOfTheHydrogenAtom.js';

const RandomUtils = {
Expand All @@ -20,7 +21,7 @@ const RandomUtils = {
*/
nextDouble( min, max ) {
assert( max > min );
return min + ( phet.joist.random.nextDouble() * ( max - min ) );
return min + ( dotRandom.nextDouble() * ( max - min ) );
},

/**
Expand All @@ -29,7 +30,7 @@ const RandomUtils = {
* @public
*/
nextBoolean() {
return phet.joist.random.nextBoolean();
return dotRandom.nextBoolean();
},

/**
Expand All @@ -38,7 +39,7 @@ const RandomUtils = {
* @public
*/
nextSign() {
return ( phet.joist.random.nextBoolean() ? +1 : -1 );
return ( dotRandom.nextBoolean() ? +1 : -1 );
},

/**
Expand All @@ -47,7 +48,7 @@ const RandomUtils = {
* @public
*/
nextAngle() {
return phet.joist.random.nextDouble( 0, 2 * Math.PI );
return dotRandom.nextDouble( 0, 2 * Math.PI );
}
};

Expand Down

0 comments on commit cd673f8

Please sign in to comment.