/ Published in: ActionScript 3
This function returns a point object based upon the position, angle and distance of a starting point (polar co-ordinates).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function getPolarPoint($startPt:Point, $degrees:Number, $distance:Number):Point { var destinationPt:Point = new Point(); destinationPt.x = $startPt.x + Math.round($distance * Math.cos( $degrees * Math.PI / 180 )); destinationPt.y = $startPt.y + Math.round($distance * Math.sin( $degrees * Math.PI / 180 )); return destinationPt; }