sorry dunno much about that, but if you explain the math behind it i can convert to an actionscript function for you