From 59482fe9396275c53ee65ec32496a9905f157484 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Tue, 7 Jan 2020 16:16:59 -0700 Subject: [PATCH] rename location to position, https://github.com/phetsims/phet-info/issues/126 --- js/common/model/Atom.js | 6 ++--- js/common/model/Bond.js | 12 +++++----- js/common/model/Molecule.js | 20 ++++++++-------- js/common/view/AtomNode.js | 4 ++-- js/common/view/BondDipoleNode.js | 6 ++--- js/common/view/BondNode.js | 8 +++---- js/common/view/MolecularDipoleNode.js | 6 ++--- js/common/view/MoleculeAngleDragHandler.js | 2 +- js/common/view/PartialChargeNode.js | 8 +++---- js/common/view/TranslateArrowsNode.js | 10 ++++---- js/threeatoms/model/ThreeAtomsModel.js | 2 +- js/threeatoms/model/TriatomicMolecule.js | 24 +++++++++---------- js/threeatoms/view/BondAngleDragHandler.js | 4 ++-- js/threeatoms/view/RotateArrowsNode.js | 8 +++---- js/threeatoms/view/ThreeAtomsScreenView.js | 6 ++--- js/threeatoms/view/TriatomicMoleculeNode.js | 2 +- js/twoatoms/model/DiatomicMolecule.js | 16 ++++++------- js/twoatoms/model/TwoAtomsModel.js | 2 +- js/twoatoms/view/DiatomicMoleculeNode.js | 2 +- js/twoatoms/view/ElectronDensityNode.js | 2 +- .../view/ElectrostaticPotentialNode.js | 2 +- js/twoatoms/view/SurfaceNode.js | 6 ++--- js/twoatoms/view/TwoAtomsScreenView.js | 6 ++--- 23 files changed, 82 insertions(+), 82 deletions(-) diff --git a/js/common/model/Atom.js b/js/common/model/Atom.js index 4b0e3266..be4de337 100644 --- a/js/common/model/Atom.js +++ b/js/common/model/Atom.js @@ -27,7 +27,7 @@ define( require => { options = merge( { diameter: MPConstants.ATOM_DIAMETER, // {number} the atom's diameter color: 'white', // {Color|string} base color of the atom - location: new Vector2( 0, 0 ), // initial location + position: new Vector2( 0, 0 ), // initial position electronegativity: MPConstants.ELECTRONEGATIVITY_RANGE.min // {number} }, options ); @@ -38,7 +38,7 @@ define( require => { this.name = name; this.diameter = options.diameter; this.color = options.color; - this.locationProperty = new Property( options.location ); + this.positionProperty = new Property( options.position ); this.electronegativityProperty = new NumberProperty( options.electronegativity ); this.partialChargeProperty = new NumberProperty( 0 ); // partial charge is zero until this atom participates in a bond } @@ -51,7 +51,7 @@ define( require => { reset: function() { this.electronegativityProperty.reset(); - // Do not reset location and partial charge, they will be reset by their parent molecule. + // Do not reset position and partial charge, they will be reset by their parent molecule. } } ); } ); \ No newline at end of file diff --git a/js/common/model/Bond.js b/js/common/model/Bond.js index 50fbb82a..139fb168 100644 --- a/js/common/model/Bond.js +++ b/js/common/model/Bond.js @@ -30,11 +30,11 @@ define( require => { // @public dispose not needed, exists for the lifetime of the sim this.dipoleProperty = new DerivedProperty( [ - atom1.locationProperty, atom2.locationProperty, + atom1.positionProperty, atom2.positionProperty, atom1.electronegativityProperty, atom2.electronegativityProperty, MPConstants.GLOBAL_OPTIONS.dipoleDirectionProperty ], - function( location1, location2, electronegativity1, electronegativity2, dipoleDirection ) { + function( position1, position2, electronegativity1, electronegativity2, dipoleDirection ) { const deltaEN = electronegativity2 - electronegativity1; @@ -65,12 +65,12 @@ define( require => { return inherit( Object, Bond, { /** - * Gets the center of the bond, the midpoint between the 2 atom locations. + * Gets the center of the bond, the midpoint between the 2 atom positions. * @returns {Vector2} * @public */ getCenter: function() { - return this.atom1.locationProperty.get().average( this.atom2.locationProperty.get() ); + return this.atom1.positionProperty.get().average( this.atom2.positionProperty.get() ); }, /** @@ -80,7 +80,7 @@ define( require => { */ getAngle: function() { const center = this.getCenter(); - return Math.atan2( this.atom2.locationProperty.get().y - center.y, this.atom2.locationProperty.get().x - center.x ); + return Math.atan2( this.atom2.positionProperty.get().y - center.y, this.atom2.positionProperty.get().x - center.x ); }, /** @@ -89,7 +89,7 @@ define( require => { * @public */ getLength: function() { - return this.atom1.locationProperty.get().distance( this.atom2.locationProperty.get() ); + return this.atom1.positionProperty.get().distance( this.atom2.positionProperty.get() ); } } ); } ); \ No newline at end of file diff --git a/js/common/model/Molecule.js b/js/common/model/Molecule.js index c0bcaff8..c758f033 100644 --- a/js/common/model/Molecule.js +++ b/js/common/model/Molecule.js @@ -20,32 +20,32 @@ define( require => { /** * @param {Atom[]} atoms - atoms that make up the molecule * @param {Bond[]} bonds - bonds between the atoms - * @param {function} updateAtomLocations - repositions the atoms (no arguments, no return value) + * @param {function} updateAtomPositions - repositions the atoms (no arguments, no return value) * @param {function} updatePartialCharges - updates the partial charges (no arguments, no return value) * @param {Object} [options] * @constructor * @abstract */ - function Molecule( atoms, bonds, updateAtomLocations, updatePartialCharges, options ) { + function Molecule( atoms, bonds, updateAtomPositions, updatePartialCharges, options ) { options = merge( { - location: new Vector2( 0, 0 ), // the point about which the molecule rotates, in global model coordinate frame - angle: 0 // angle of rotation of the entire molecule about the location, in radians + position: new Vector2( 0, 0 ), // the point about which the molecule rotates, in global model coordinate frame + angle: 0 // angle of rotation of the entire molecule about the position, in radians }, options ); const self = this; // @public (read-only) - this.location = options.location; // the point about which the molecule rotates, in global model coordinate frame + this.position = options.position; // the point about which the molecule rotates, in global model coordinate frame this.atoms = atoms; this.bonds = bonds; // @public - this.angleProperty = new NumberProperty( options.angle ); // angle of rotation about the location, in radians + this.angleProperty = new NumberProperty( options.angle ); // angle of rotation about the position, in radians this.dragging = false; // true when the user is dragging the molecule - // update atom locations when molecule is rotated - this.angleProperty.link( updateAtomLocations.bind( this ) ); // unlink not needed + // update atom positions when molecule is rotated + this.angleProperty.link( updateAtomPositions.bind( this ) ); // unlink not needed // bond dipoles, for deriving molecular dipole const bondDipoleProperties = []; @@ -79,12 +79,12 @@ define( require => { }, /** - * Creates a transform that accounts for the molecule's location and orientation. + * Creates a transform that accounts for the molecule's position and orientation. * @returns {Matrix3} * @public */ createTransformMatrix: function() { - return Matrix3.translationFromVector( this.location ).timesMatrix( Matrix3.rotation2( this.angleProperty.get() ) ); + return Matrix3.translationFromVector( this.position ).timesMatrix( Matrix3.rotation2( this.angleProperty.get() ) ); } } ); } ); \ No newline at end of file diff --git a/js/common/view/AtomNode.js b/js/common/view/AtomNode.js index e2376526..639614a2 100644 --- a/js/common/view/AtomNode.js +++ b/js/common/view/AtomNode.js @@ -38,8 +38,8 @@ define( require => { children: [ sphereNode, textNode ] } ); - // sync location with model, unlink not needed - atom.locationProperty.linkAttribute( this, 'translation' ); + // sync position with model, unlink not needed + atom.positionProperty.linkAttribute( this, 'translation' ); } moleculePolarity.register( 'AtomNode', AtomNode ); diff --git a/js/common/view/BondDipoleNode.js b/js/common/view/BondDipoleNode.js index 912ae423..a7579294 100644 --- a/js/common/view/BondDipoleNode.js +++ b/js/common/view/BondDipoleNode.js @@ -35,17 +35,17 @@ define( require => { const isInPhase = Math.abs( bondAngle - dipole.angle ) < ( Math.PI / 4 ); const dipoleViewLength = dipole.magnitude * ( self.referenceLength / self.referenceMagnitude ); - // location of tail in polar coordinates, relative to center of bond + // position of tail in polar coordinates, relative to center of bond const offsetX = isInPhase ? ( dipoleViewLength / 2 ) : -( dipoleViewLength / 2 ); const offsetAngle = Math.atan( offsetX / PERPENDICULAR_OFFSET ); const tailDistance = PERPENDICULAR_OFFSET / Math.cos( offsetAngle ); const tailAngle = bondAngle - ( Math.PI / 2 ) - offsetAngle; - // location of tail in Cartesian coordinates, relative to center of bond + // position of tail in Cartesian coordinates, relative to center of bond const tailX = tailDistance * Math.cos( tailAngle ); const tailY = tailDistance * Math.sin( tailAngle ); - // location of tail in global coordinate frame + // position of tail in global coordinate frame self.translation = bond.getCenter().plusXY( tailX, tailY ); } ); } diff --git a/js/common/view/BondNode.js b/js/common/view/BondNode.js index f1afea1f..95edd2a8 100644 --- a/js/common/view/BondNode.js +++ b/js/common/view/BondNode.js @@ -3,7 +3,7 @@ /** * Visual representation of a bond between 2 atoms. * Intended to be rendered before the 2 atoms, so that the atoms cover the portion of the bond that overlaps the atoms. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * Clients should not attempt to position this node. * * @author Chris Malley (PixelZoom, Inc.) @@ -25,15 +25,15 @@ define( require => { const self = this; - Line.call( this, bond.atom1.locationProperty.get(), bond.atom2.locationProperty.get(), { + Line.call( this, bond.atom1.positionProperty.get(), bond.atom2.positionProperty.get(), { stroke: MPColors.BOND, lineWidth: 12, strokePickable: true // include stroke in hit-testing } ); // adjust the bond when its endpoints change, unlinks not needed - bond.atom1.locationProperty.link( function( location ) { self.setPoint1( location ); } ); - bond.atom2.locationProperty.link( function( location ) { self.setPoint2( location ); } ); + bond.atom1.positionProperty.link( function( position ) { self.setPoint1( position ); } ); + bond.atom2.positionProperty.link( function( position ) { self.setPoint2( position ); } ); } moleculePolarity.register( 'BondNode', BondNode ); diff --git a/js/common/view/MolecularDipoleNode.js b/js/common/view/MolecularDipoleNode.js index 879b5371..9fde5613 100644 --- a/js/common/view/MolecularDipoleNode.js +++ b/js/common/view/MolecularDipoleNode.js @@ -27,15 +27,15 @@ define( require => { DipoleNode.call( this, molecule.dipoleProperty, MPColors.MOLECULAR_DIPOLE ); - // position the dipole with some radial offset from the molecule's location, unlink not needed + // position the dipole with some radial offset from the molecule's position, unlink not needed const self = this; molecule.dipoleProperty.link( function( dipole ) { - // offset vector relative to molecule location + // offset vector relative to molecule position const v = Vector2.createPolar( OFFSET, dipole.angle ); // offset in global coordinate frame - self.translation = molecule.location.plus( v ); + self.translation = molecule.position.plus( v ); } ); } diff --git a/js/common/view/MoleculeAngleDragHandler.js b/js/common/view/MoleculeAngleDragHandler.js index 133fbc30..bb395ceb 100644 --- a/js/common/view/MoleculeAngleDragHandler.js +++ b/js/common/view/MoleculeAngleDragHandler.js @@ -29,7 +29,7 @@ define( require => { */ const getAngle = function( event ) { const point = relativeNode.globalToParentPoint( event.pointer.point ); - return new Vector2( point.x - molecule.location.x, point.y - molecule.location.y ).angle; + return new Vector2( point.x - molecule.position.x, point.y - molecule.position.y ).angle; }; SimpleDragHandler.call( this, { diff --git a/js/common/view/PartialChargeNode.js b/js/common/view/PartialChargeNode.js index 1f32ff05..6d487e68 100644 --- a/js/common/view/PartialChargeNode.js +++ b/js/common/view/PartialChargeNode.js @@ -75,12 +75,12 @@ define( require => { // Compute the amount to move the partial charge node const multiplier = ( atom.diameter / 2 ) + ( Math.max( self.width, self.height ) / 2 ) + 3; const relativeOffset = unitVector.timesScalar( multiplier ); - self.translation = atom.locationProperty.get().plus( relativeOffset ); + self.translation = atom.positionProperty.get().plus( relativeOffset ); } }; atom.partialChargeProperty.link( this.update.bind( this ) ); // unlink not needed - atom.locationProperty.link( this.update.bind( this ) ); // unlink not needed + atom.positionProperty.link( this.update.bind( this ) ); // unlink not needed } moleculePolarity.register( 'PartialChargeNode', PartialChargeNode ); @@ -109,10 +109,10 @@ define( require => { return new PartialChargeNode( atom, function() { // along the bond axis, in the direction of the atom - let v = atom.locationProperty.get().minus( bond.getCenter() ); + let v = atom.positionProperty.get().minus( bond.getCenter() ); /* - * Avoid the case where pressing Reset All causes the atoms to swap locations, temporarily resulting + * Avoid the case where pressing Reset All causes the atoms to swap positions, temporarily resulting * in a zero-magnitude vector when the first atom has moved but the second atom hasn't moved yet. * This sorts itself out when both atoms have moved. */ diff --git a/js/common/view/TranslateArrowsNode.js b/js/common/view/TranslateArrowsNode.js index 3f6452c9..f346a72a 100644 --- a/js/common/view/TranslateArrowsNode.js +++ b/js/common/view/TranslateArrowsNode.js @@ -2,7 +2,7 @@ /** * A pair of arrows that are placed around an atom to indicate that the atom can be translated. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ @@ -45,12 +45,12 @@ define( require => { options.children = [ leftArrowNode, rightArrowNode ]; // unlink not needed - atom.locationProperty.link( function() { + atom.positionProperty.link( function() { - // transform the arrow shapes to account for atom location and relationship to molecule location - const v = molecule.location.minus( atom.locationProperty.get() ); + // transform the arrow shapes to account for atom position and relationship to molecule position + const v = molecule.position.minus( atom.positionProperty.get() ); const angle = v.angle - ( Math.PI / 2 ); - const transform = new Transform3( Matrix3.translationFromVector( atom.locationProperty.get() ).timesMatrix( Matrix3.rotation2( angle ) ) ); + const transform = new Transform3( Matrix3.translationFromVector( atom.positionProperty.get() ).timesMatrix( Matrix3.rotation2( angle ) ) ); leftArrowNode.shape = transform.transformShape( leftArrow ); rightArrowNode.shape = transform.transformShape( rightArrow ); } ); diff --git a/js/threeatoms/model/ThreeAtomsModel.js b/js/threeatoms/model/ThreeAtomsModel.js index 4feb1cc7..3cbfa372 100644 --- a/js/threeatoms/model/ThreeAtomsModel.js +++ b/js/threeatoms/model/ThreeAtomsModel.js @@ -19,7 +19,7 @@ define( require => { * @constructor */ function ThreeAtomsModel() { - MPModel.call( this, new TriatomicMolecule( { location: new Vector2( 400, 280 ) } ) ); + MPModel.call( this, new TriatomicMolecule( { position: new Vector2( 400, 280 ) } ) ); } moleculePolarity.register( 'ThreeAtomsModel', ThreeAtomsModel ); diff --git a/js/threeatoms/model/TriatomicMolecule.js b/js/threeatoms/model/TriatomicMolecule.js index e2cb086f..e9481d29 100644 --- a/js/threeatoms/model/TriatomicMolecule.js +++ b/js/threeatoms/model/TriatomicMolecule.js @@ -56,13 +56,13 @@ define( require => { Molecule.call( this, [ this.atomA, this.atomB, this.atomC ], [ this.bondAB, this.bondBC ], - this.updateAtomLocations, + this.updateAtomPositions, this.updatePartialCharges, options ); // unlinks not needed - this.bondAngleAProperty.link( this.updateAtomLocations.bind( this ) ); - this.bondAngleCProperty.link( this.updateAtomLocations.bind( this ) ); + this.bondAngleAProperty.link( this.updateAtomPositions.bind( this ) ); + this.bondAngleCProperty.link( this.updateAtomPositions.bind( this ) ); } moleculePolarity.register( 'TriatomicMolecule', TriatomicMolecule ); @@ -72,14 +72,14 @@ define( require => { * * @param {Atom} atom the atom to reposition * @param {number} bondAngle the angle of the bond that the atom participates in - * @param {Vector2 location location of the molecule + * @param {Vector2 position position of the molecule * @param {number} angle orientation of the molecule */ - const updateAtomLocation = function( atom, bondAngle, location, angle ) { + const updateAtomPosition = function( atom, bondAngle, position, angle ) { const thetaA = angle + bondAngle; - const xA = ( MPConstants.BOND_LENGTH * Math.cos( thetaA ) ) + location.x; - const yA = ( MPConstants.BOND_LENGTH * Math.sin( thetaA ) ) + location.y; - atom.locationProperty.set( new Vector2( xA, yA ) ); + const xA = ( MPConstants.BOND_LENGTH * Math.cos( thetaA ) ) + position.x; + const yA = ( MPConstants.BOND_LENGTH * Math.sin( thetaA ) ) + position.y; + atom.positionProperty.set( new Vector2( xA, yA ) ); }; return inherit( Molecule, TriatomicMolecule, { @@ -98,10 +98,10 @@ define( require => { * Repositions the atoms. * @private */ - updateAtomLocations: function() { - this.atomB.locationProperty.set( this.location ); // atom B remains at the molecule's location - updateAtomLocation( this.atomA, this.bondAngleAProperty.get(), this.location, this.angleProperty.get() ); - updateAtomLocation( this.atomC, this.bondAngleCProperty.get(), this.location, this.angleProperty.get() ); + updateAtomPositions: function() { + this.atomB.positionProperty.set( this.position ); // atom B remains at the molecule's position + updateAtomPosition( this.atomA, this.bondAngleAProperty.get(), this.position, this.angleProperty.get() ); + updateAtomPosition( this.atomC, this.bondAngleCProperty.get(), this.position, this.angleProperty.get() ); }, /** diff --git a/js/threeatoms/view/BondAngleDragHandler.js b/js/threeatoms/view/BondAngleDragHandler.js index df75acb0..c10c552f 100644 --- a/js/threeatoms/view/BondAngleDragHandler.js +++ b/js/threeatoms/view/BondAngleDragHandler.js @@ -27,13 +27,13 @@ define( require => { let previousAngle = 0; /** - * Finds the angle about the molecule's location. + * Finds the angle about the molecule's position. * @param {SceneryEvent} event * @returns {number} angle in radians */ const getAngle = function( event ) { const point = event.currentTarget.getParent().globalToLocalPoint( event.pointer.point ); - return new Vector2( point.x - molecule.location.x, point.y - molecule.location.y ).angle; + return new Vector2( point.x - molecule.position.x, point.y - molecule.position.y ).angle; }; SimpleDragHandler.call( this, { diff --git a/js/threeatoms/view/RotateArrowsNode.js b/js/threeatoms/view/RotateArrowsNode.js index 823198e0..fdbe0eca 100644 --- a/js/threeatoms/view/RotateArrowsNode.js +++ b/js/threeatoms/view/RotateArrowsNode.js @@ -2,7 +2,7 @@ /** * A pair of arrows used to indicate that an arrow can be rotated. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ @@ -37,14 +37,14 @@ define( require => { ] } ); - // Align with atom location and molecular dipole + // Align with atom position and molecular dipole const updateTransform = function() { this.matrix = Matrix3 - .translationFromVector( atom.locationProperty.get() ) + .translationFromVector( atom.positionProperty.get() ) .timesMatrix( Matrix3.rotation2( molecule.dipoleProperty.get().angle + Math.PI / 2 ) ); }; molecule.dipoleProperty.link( updateTransform.bind( this ) ); // unlink not needed - atom.locationProperty.link( updateTransform.bind( this ) ); // unlink not needed + atom.positionProperty.link( updateTransform.bind( this ) ); // unlink not needed } moleculePolarity.register( 'RotateArrowsNode', RotateArrowsNode ); diff --git a/js/threeatoms/view/ThreeAtomsScreenView.js b/js/threeatoms/view/ThreeAtomsScreenView.js index 3e8f4fd6..d93794ec 100644 --- a/js/threeatoms/view/ThreeAtomsScreenView.js +++ b/js/threeatoms/view/ThreeAtomsScreenView.js @@ -79,10 +79,10 @@ define( require => { } ); this.addChild( rootNode ); - // layout, based on molecule location --------------------------------- + // layout, based on molecule position --------------------------------- - const moleculeX = model.molecule.location.x; - const moleculeY = model.molecule.location.y; + const moleculeX = model.molecule.position.x; + const moleculeY = model.molecule.position.y; // to left of molecule, vertically centered negativePlateNode.right = moleculeX - PLATE_X_OFFSET; diff --git a/js/threeatoms/view/TriatomicMoleculeNode.js b/js/threeatoms/view/TriatomicMoleculeNode.js index e2296d8e..28bf941c 100644 --- a/js/threeatoms/view/TriatomicMoleculeNode.js +++ b/js/threeatoms/view/TriatomicMoleculeNode.js @@ -2,7 +2,7 @@ /** * Visual representation of a triatomic molecule. - * Children position themselves in global coordinates, so this node's location should be (0,0). + * Children position themselves in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ diff --git a/js/twoatoms/model/DiatomicMolecule.js b/js/twoatoms/model/DiatomicMolecule.js index e060a849..248a5b82 100644 --- a/js/twoatoms/model/DiatomicMolecule.js +++ b/js/twoatoms/model/DiatomicMolecule.js @@ -44,7 +44,7 @@ define( require => { Molecule.call( this, [ this.atomA, this.atomB ], [ this.bond ], - this.updateAtomLocations, + this.updateAtomPositions, this.updatePartialCharges, options ); } @@ -66,19 +66,19 @@ define( require => { * Repositions the atoms. * @private */ - updateAtomLocations: function() { + updateAtomPositions: function() { const radius = MPConstants.BOND_LENGTH / 2; // atom A - const xA = ( radius * Math.cos( this.angleProperty.get() + Math.PI ) ) + this.location.x; - const yA = ( radius * Math.sin( this.angleProperty.get() + Math.PI ) ) + this.location.y; - this.atomA.locationProperty.set( new Vector2( xA, yA ) ); + const xA = ( radius * Math.cos( this.angleProperty.get() + Math.PI ) ) + this.position.x; + const yA = ( radius * Math.sin( this.angleProperty.get() + Math.PI ) ) + this.position.y; + this.atomA.positionProperty.set( new Vector2( xA, yA ) ); // atom B - const xB = ( radius * Math.cos( this.angleProperty.get() ) ) + this.location.x; - const yB = ( radius * Math.sin( this.angleProperty.get() ) ) + this.location.y; - this.atomB.locationProperty.set( new Vector2( xB, yB ) ); + const xB = ( radius * Math.cos( this.angleProperty.get() ) ) + this.position.x; + const yB = ( radius * Math.sin( this.angleProperty.get() ) ) + this.position.y; + this.atomB.positionProperty.set( new Vector2( xB, yB ) ); }, /** diff --git a/js/twoatoms/model/TwoAtomsModel.js b/js/twoatoms/model/TwoAtomsModel.js index 2de09e9f..e3ed0450 100644 --- a/js/twoatoms/model/TwoAtomsModel.js +++ b/js/twoatoms/model/TwoAtomsModel.js @@ -19,7 +19,7 @@ define( require => { * @constructor */ function TwoAtomsModel() { - MPModel.call( this, new DiatomicMolecule( { location: new Vector2( 380, 280 ) } ) ); + MPModel.call( this, new DiatomicMolecule( { position: new Vector2( 380, 280 ) } ) ); } moleculePolarity.register( 'TwoAtomsModel', TwoAtomsModel ); diff --git a/js/twoatoms/view/DiatomicMoleculeNode.js b/js/twoatoms/view/DiatomicMoleculeNode.js index 14096a27..346c9150 100644 --- a/js/twoatoms/view/DiatomicMoleculeNode.js +++ b/js/twoatoms/view/DiatomicMoleculeNode.js @@ -2,7 +2,7 @@ /** * Visual representation of a diatomic molecule. - * Children position themselves in global coordinates, so this node's location should be (0,0). + * Children position themselves in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ diff --git a/js/twoatoms/view/ElectronDensityNode.js b/js/twoatoms/view/ElectronDensityNode.js index 65c947ca..61884f29 100644 --- a/js/twoatoms/view/ElectronDensityNode.js +++ b/js/twoatoms/view/ElectronDensityNode.js @@ -4,7 +4,7 @@ * 2D surface that represents electron density for a diatomic molecule. * Electron density uses a 2-color gradient, so we can use a single PPath. * This node's look is similar to the corresponding Jmol isosurface. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ diff --git a/js/twoatoms/view/ElectrostaticPotentialNode.js b/js/twoatoms/view/ElectrostaticPotentialNode.js index 7292be66..c966745d 100644 --- a/js/twoatoms/view/ElectrostaticPotentialNode.js +++ b/js/twoatoms/view/ElectrostaticPotentialNode.js @@ -4,7 +4,7 @@ * 2D surface that represents electrostatic potential for a diatomic molecule. * Electron density uses a 3-color gradient, so we use 2 Path nodes that meet in the middle. * This node's look is similar to the corresponding Jmol isosurface. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ diff --git a/js/twoatoms/view/SurfaceNode.js b/js/twoatoms/view/SurfaceNode.js index 7d9808e0..241520ee 100644 --- a/js/twoatoms/view/SurfaceNode.js +++ b/js/twoatoms/view/SurfaceNode.js @@ -3,7 +3,7 @@ /** * Abstract base type for 2D surfaces. * The 'look' of 2D surfaces is similar to the corresponding Jmol 3D isosurfaces, see http://jmol.sourceforge.net/docs/surface/. - * Shapes are created in global coordinates, so this node's location should be (0,0). + * Shapes are created in global coordinates, so this node's position should be (0,0). * * @author Chris Malley (PixelZoom, Inc.) */ @@ -47,8 +47,8 @@ define( require => { // each atom is surrounded with a 'cloud' (circle) const radius = this.molecule.atomA.diameter * DIAMETER_SCALE / 2; this.path = new Path( new Shape() - .arc( molecule.location.x - this.molecule.atomB.locationProperty.get().x, molecule.location.y - this.molecule.atomB.locationProperty.get().y, radius, Math.PI / 4, 7 * Math.PI / 4 ) - .arc( molecule.location.x - this.molecule.atomA.locationProperty.get().x, molecule.location.y - this.molecule.atomA.locationProperty.get().y, radius, 5 * Math.PI / 4, 3 * Math.PI / 4 ) + .arc( molecule.position.x - this.molecule.atomB.positionProperty.get().x, molecule.position.y - this.molecule.atomB.positionProperty.get().y, radius, Math.PI / 4, 7 * Math.PI / 4 ) + .arc( molecule.position.x - this.molecule.atomA.positionProperty.get().x, molecule.position.y - this.molecule.atomA.positionProperty.get().y, radius, 5 * Math.PI / 4, 3 * Math.PI / 4 ) ); this.addChild( this.path ); diff --git a/js/twoatoms/view/TwoAtomsScreenView.js b/js/twoatoms/view/TwoAtomsScreenView.js index 07fb8849..3fd94762 100644 --- a/js/twoatoms/view/TwoAtomsScreenView.js +++ b/js/twoatoms/view/TwoAtomsScreenView.js @@ -88,10 +88,10 @@ define( require => { } ); this.addChild( rootNode ); - // layout, based on molecule location --------------------------------- + // layout, based on molecule position --------------------------------- - const moleculeX = model.molecule.location.x; - const moleculeY = model.molecule.location.y; + const moleculeX = model.molecule.position.x; + const moleculeY = model.molecule.position.y; // to left of molecule, vertically centered negativePlateNode.right = moleculeX - PLATE_X_OFFSET;