Animation Play, Pause, and Reset

Play and pause an animation in a graph with a single button click. Reset the animation at the end of the loop.

I don’t understand what the P=mod(p,2) is there for - but when I delete it, nothing works so it seems important. I’m trying to get a rotation to animate but all I can do so far is get the original, have a student enter the degrees, and have the image appear when student hits the submit button. Trying to find an easier way other than defining sub-polygons to appear at some intervals of time.

the mod function is used here to alternate between odd and even button presses. Odd presses = play, even = reset.

If you’re looking to have a polygon rotate, you can make the points in polar form rather than raw cartesian. That way the angle can be manipulated with a single sink.

Hope this helps!

1 Like

mod(p,2) is basically outputting the remainder of p/2, so even numbers it equals 0, and odd 1. Thus, as Jay said, odd number of presses, p, = play, and even = reset.

Ok… so, would you mind looking at slide 6 in here (please ignore the rest, it’s a work-in-progress and I’m not sure which slides to delete yet!) and tell my why my play/pause button doesn’t work? 7.2.1 Intro to Special Quads and Proofs • Activity Builder by Desmos

Here’s what I came up with. I put all my new work in the New Stuff folder with notes. I put comments for anything I added in the button and graph CL.

1 Like

Thanks, Daniel, you’re awesome! I had been wondering why people always redefine component names at the top of the CL, now that makes sense. I also hadn’t known how to turn lists to be able to use them as variable, so thanks for that tip as well!! I’ll play around with this some more, I don’t fully understand where the “this” came from in your graph CL, but now I can get this thing rotating, thanks again!!

you use this to refer to the component you’re in, so instead of “graph4” within graph4, you can use “this” (i.e. “this component”) again so you don’t need to change any component names when copying the slide.

1 Like