diff --git a/js/bloch-sphere/model/BlochSphereModel.ts b/js/bloch-sphere/model/BlochSphereModel.ts index 9fee6a3..8b33c29 100644 --- a/js/bloch-sphere/model/BlochSphereModel.ts +++ b/js/bloch-sphere/model/BlochSphereModel.ts @@ -148,9 +148,14 @@ export default class BlochSphereModel implements TModel { } ); - this.magneticFieldStrengthProperty.link( magneticFieldStrength => { - this.singleMeasurementBlochSphere.rotatingSpeedProperty.value = magneticFieldStrength; - } ); + Multilink.multilink( + [ this.magneticFieldStrengthProperty, this.selectedSceneProperty ], + ( magneticFieldStrength, selectedScene ) => { + this.singleMeasurementBlochSphere.rotatingSpeedProperty.value = selectedScene === BlochSphereScene.PRECESSION ? + magneticFieldStrength : + 0; + } + ); this.preparationBlochSphere.polarAngleProperty.link( polarAngle => { this.singleMeasurementBlochSphere.polarAngleProperty.value = polarAngle; diff --git a/js/bloch-sphere/model/ComplexBlochSphere.ts b/js/bloch-sphere/model/ComplexBlochSphere.ts index 723cbe8..ecd06bd 100644 --- a/js/bloch-sphere/model/ComplexBlochSphere.ts +++ b/js/bloch-sphere/model/ComplexBlochSphere.ts @@ -46,7 +46,9 @@ export default class ComplexBlochSphere extends AbstractBlochSphere { * Abstract method that should run calculations to update the Bloch Sphere representation. */ public override step( dt: number ): void { - this.azimuthalAngleProperty.value = Utils.moduloBetweenDown( this.azimuthalAngleProperty.value + this.rotatingSpeedProperty.value * dt, 0, 2 * Math.PI ); + this.azimuthalAngleProperty.value = Utils.moduloBetweenDown( + this.azimuthalAngleProperty.value + this.rotatingSpeedProperty.value * dt, 0, 2 * Math.PI + ); } public override reset(): void {