Skip to content

Commit

Permalink
Convert LinearFunction to a class with an evaluate method, see phetsi…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 2, 2021
1 parent f010e70 commit e13b346
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/model/ParticleAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ class ParticleAtom extends PhetioObject {
const radiusB = 10;
const scaleFactorA = 2.4;
const scaleFactorB = 1.35;
const scaleFunction = LinearFunction( radiusA, radiusB, scaleFactorA, scaleFactorB, this.nucleonRadius );
const scaleFactor = scaleFunction( this.nucleonRadius );
const scaleFunction = new LinearFunction( radiusA, radiusB, scaleFactorA, scaleFactorB, this.nucleonRadius );
const scaleFactor = scaleFunction.evaluate( this.nucleonRadius );

for ( let i = 0; i < nucleons.length; i++ ) {
nucleons[ i ].destinationProperty.set( new Vector2( centerX + placementRadius * Math.cos( placementAngle ),
Expand Down
2 changes: 1 addition & 1 deletion js/view/IsotopeElectronCloudView.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class IsotopeElectronCloudView extends Circle {
const maxChangedRadius = 55;

const compressionFunction = new LinearFunction( minShellRadius, maxShellRadius, minChangedRadius, maxChangedRadius );
return compressionFunction( value );
return compressionFunction.evaluate( value );
};

if ( numElectrons in mapElectronCountToRadius ) {
Expand Down

0 comments on commit e13b346

Please sign in to comment.