Open veillette opened 7 years ago
@veillette I noticed that I was able to to draw the 0 V equipotential line in the middle of a dipole, but the tool fails to draw 0 V lines for a quadrupole (which would intersect). I'm not sure how pedagogically beneficial it would be to draw the zero lines, so I wonder if it would be better for the draw button to become inactive when at a zero point.
Given that charges can be snapped to the grid (see #98), it is much easier to have configurations of charges that are on top of one another.
The previous implementation attempted to determined if the E field is zero everywhere. However the check was not exhaustive since it was incredibly unlikely (and difficult) to generate such charge configurations. This is no longer the case when you can snapped charges to specific positions. This should be addressed.
We should revisit the algorithm for updateIsPlayAreaCharged:
An assertion can be triggered when 3 positive and three negative charges are put on top of one another.
:8080/assert/js/assert.js:30 enabling assert assert.js:20 Assertion failed: the magnitude of the electric field is zero: initial Electric Field assert.js:21 Uncaught Error: Assertion failed: the magnitude of the electric field is zero: initial Electric Field at window.assertions.assertFunction (assert.js:21) at ElectricPotentialLine.getNextPositionAlongEquipotentialWithElectricPotential (ElectricPotentialLine.js?bust=1500170287700:99) at ElectricPotentialLine.getEquipotentialPositionArray (ElectricPotentialLine.js?bust=1500170287700:193) at new ElectricPotentialLine (ElectricPotentialLine.js?bust=1500170287700:59) at ChargesAndFieldsModel.addElectricPotentialLine (ChargesAndFieldsModel.js?bust=1500170287700:625) at listener (ElectricPotentialSensorNode.js?bust=1500170287700:133) at PushButtonModel.js?bust=1500170287700:168 at Array.forEach ()
at PushButtonModel.fire (PushButtonModel.js?bust=1500170287700:167)
at Array. (PushButtonModel.js?bust=1500170287700:102)