From 9c63e09a65ab21c0e9ae3e90fd061756cf46aa4d Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Fri, 29 Mar 2024 14:19:20 -0600 Subject: [PATCH] add assertions where initial positions are defined, https://github.com/phetsims/faradays-electromagnetic-lab/issues/150 --- js/pickup-coil/model/PickupCoilScreenModel.ts | 3 +++ js/transformer/model/TransformerScreenModel.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/js/pickup-coil/model/PickupCoilScreenModel.ts b/js/pickup-coil/model/PickupCoilScreenModel.ts index 44c61c4a..2f9b62a9 100644 --- a/js/pickup-coil/model/PickupCoilScreenModel.ts +++ b/js/pickup-coil/model/PickupCoilScreenModel.ts @@ -26,6 +26,9 @@ const BAR_MAGNET_POSITION = new Vector2( 200, Y_POSITION ); const PICKUP_COIL_POSITION = new Vector2( 500, Y_POSITION ); const COMPASS_POSITION = new Vector2( 635, Y_POSITION ); +assert && assert( BAR_MAGNET_POSITION.y === PICKUP_COIL_POSITION.y, + 'Bar magnet and pickup coil must have the same initial y coordinate for the Lock to Axis feature.' ); + export default class PickupCoilScreenModel extends FELScreenModel { public readonly barMagnet: BarMagnet; diff --git a/js/transformer/model/TransformerScreenModel.ts b/js/transformer/model/TransformerScreenModel.ts index 23148566..114e1516 100644 --- a/js/transformer/model/TransformerScreenModel.ts +++ b/js/transformer/model/TransformerScreenModel.ts @@ -24,6 +24,9 @@ const ELECTROMAGNET_POSITION = new Vector2( 200, Y_POSITION ); const PICKUP_COIL_POSITION = new Vector2( 500, Y_POSITION ); const COMPASS_POSITION = new Vector2( 635, Y_POSITION ); +assert && assert( ELECTROMAGNET_POSITION.y === PICKUP_COIL_POSITION.y, + 'Electromagnet and pickup coil must have the same initial y coordinate for the Lock to Axis feature.' ); + export default class TransformerScreenModel extends FELScreenModel { public readonly transformer: Transformer;