phetsims / pendulum-lab

"Pendulum Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 10 forks source link

"Snap" to discrete angles #195

Closed oliver-phet closed 6 years ago

oliver-phet commented 6 years ago

The sim currently allows users to drag two masses to different angles, but the sim displays the same angle. For example, both of these pendulums were dragged to "40°" screen shot 2017-09-25 at 2 29 19 pm

The Flash version forced the pendulum to "snap" to discrete angles. Which we should try to emulate this behavior since the current implementation can be misleading.

This was brought up by a teacher who was getting different period times for identically configured pendulums.

Assigning to @arouinfar for now.

arouinfar commented 6 years ago

This appears to be an oversight, as I thought the displacement already snapped to a whole number of degrees. @jonathanolson can you make this change? Once the angle is snappy, we can test again and see how well the period agrees.

jonathanolson commented 6 years ago

Implemented, can you verify?

arouinfar commented 6 years ago

Looking good @jonathanolson!

oliver-phet commented 6 years ago

This looks good to me, too!

jonathanolson commented 6 years ago

Applied to the 1.0 branch, closing.

phet-steele commented 6 years ago

pl04

Don't ask how in the world the pendulum started swinging, it just did... and no I did NOT have friction during this. These problems are also closely reminiscent #91 and #128. @arouinfar @jonathanolson we should probably not allow snapping to 180 degrees, or if we do there needs to be more discussion.

arouinfar commented 6 years ago

we should probably not allow snapping to 180 degrees

That would be perfectly fine with me @phet-steele @jonathanolson.

jonathanolson commented 6 years ago

Applied fix to master and the release branch. @phet-steele and @arouinfar can you verify?

arouinfar commented 6 years ago

I like the new behavior @jonathanolson, let's hope @phet-steele isn't able to break it. :)

arouinfar commented 6 years ago

@oliver-phet can you please notify the user that we've published a maintenance release that addresses this issue?

jonathanolson commented 6 years ago

Looks like change using Util.sign worked on master, but had an older copy of dot in its SHAs. @phet-steele, https://www.colorado.edu/physics/phet/dev/html/pendulum-lab/1.0.2-rc.1/pendulum-lab_en.html should presumably solve the issue on production?

phet-steele commented 6 years ago

Good to go JO, thanks for the quick turn around.

jonathanolson commented 6 years ago

Deployed, http://phet.colorado.edu/sims/html/pendulum-lab/1.0.2/pendulum-lab_en.html should have fix in place.

oliver-phet commented 6 years ago

Email to user sent. Closing for now.