Skip to content

Commit

Permalink
Fixed var declaration site, see #78
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 13, 2016
1 parent e9fc366 commit 8d916a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/gravity-force-lab/model/GravityForceLabModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ define( function( require ) {
* @constructor
*/
function GravityForceLabModel() {
var self = this;
this.massRange = new RangeWithValue( 1, 1000 ); // @public

this.forceProperty = new Property( 0 ); // @public (read-only)
Expand Down Expand Up @@ -79,9 +78,8 @@ define( function( require ) {
var change_factor = 0.0001; // this is empirically determined larger change factor may make masses farther but converges faster
var sumRadius = this.mass1.radiusProperty.get() + this.mass2.radiusProperty.get() + MIN_SEPARATION_BETWEEN_MASSES;
var changed = false;
var i = 0;
// for loop is to make sure after checking the boundaries constraints masses don't overlap
for ( i = 0; i < 10; i++ ) {
for ( var i = 0; i < 10; i++ ) {
// check for overlap and move both masses so that they don't overlap
if ( Math.abs( locationMass1 - locationMass2 ) < sumRadius ) {
while ( Math.abs( locationMass1 - locationMass2 ) < sumRadius ) {
Expand Down

0 comments on commit 8d916a2

Please sign in to comment.