MeetingI X — Animation (of sort)

Eclipse homework from 2017

We continue with the last class.

Write a simple animation of a solar eclipse.

Use a wide window, say 1000×200.

The two objects in your animation, sun and moon, will move from left to right at slightly different speeds. The background of your window represents the sky.

The moon should be a tiny bit bigger than the sun but move a little faster.

The sun gets a head start, but the moon should be directly in front of the sun when both are at the center of the windows.

Of course, the background get darker as the moon blocks more of the sun.

If you want to see a real formula for determining how much darker, look at Wolfram Mathworld’s formula for Circle-Circle Intersection. By the way, I could never get it to work.

Some works in progress

These will be made readables as the class continues.

Doing more and more

Work on some of these.