Day/Night Simulation

Everyone knows that day is the time between sunrise and sunset, when it's light, and night is the rest of the time, when it's dark. But what makes the Sun rise and set?

You can take a giant step into space and observe the Sun/Earth/Moon system in action. Or you can look at just the Earth/Moon system if you like. You control how you view the action.