You can download the flash 9 AS 3.0 preview for free from adobe.

Missed your edit :/

The math behind it isnt too hard. There is a full chapter on that kind of stuff in Flash MX Game design demistified.