In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: cubicCurverToを使って円を描く

Get Adobe Flash player
by makc3d 23 Feb 2012
/**
 * Copyright makc3d ( http://wonderfl.net/user/makc3d )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/tDRR
 */

// forked from wh0's cubicCurverToを使って円を描く
// forked from UKI0809's curverToを使って円を描く
package{
    import flash.display.Sprite;
    public class drawCircle3 extends Sprite {
        
        private static const RATIO:Number = 4 / 3 * (Math.SQRT2 - 1);
        
        public function drawCircle3() {
            var centerX:Number = 100;
            var centerY:Number = 200;
            var r:Number = 50;
            
            graphics.lineStyle(2,0xff0006);
            graphics.moveTo(centerX+r, centerY);
            
            graphics.cubicCurveTo(centerX + r, centerY - r * RATIO, centerX + r * RATIO, centerY - r, centerX, centerY - r);
            graphics.cubicCurveTo(centerX - r * RATIO, centerY - r, centerX - r, centerY - r * RATIO, centerX - r, centerY);
            graphics.cubicCurveTo(centerX - r, centerY + r * RATIO, centerX - r * RATIO, centerY + r, centerX, centerY + r);
            graphics.cubicCurveTo(centerX + r * RATIO, centerY + r, centerX + r, centerY + r * RATIO, centerX + r, centerY);
        
        }

    }
}