/elm-ball

Bouncing ball simulation in Elm

Primary LanguageElm

Bouncing Ball

This is a helloworld program written in the Elm programming language.

It implements some simple numerical simulation (a bouncing ball) and basic input handling.

If a user does not interfere, the ball should bounce forever at the same height. User can move the ground line up and down by click-and-drag anywhere at the whitespace. This way a user can either catch the ball tenderly, preventing a bounce, or push it high into air, out of screen.

In the bottom line, K stands for kinetic energy, P for gravitational potential, D for potential energy of deformation. The full energy E=K+P+D should remain constant for reasonably fine simulation (i.e. moderate ball velocity).