forked from: 【wonderfl本】curveTo

by ir_77 forked from 【wonderfl本】curveTo (diff: 4)
♥0 | Line 24 | Modified 2010-06-29 13:38:57 | MIT License
play

ActionScript3 source code

/**
 * Copyright ir_77 ( http://wonderfl.net/user/ir_77 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7Dck
 */

// forked from Knuckle's 【wonderfl本】curveTo
package {
    import flash.display.Sprite;
    public class DrawCircle3 extends Sprite {
        public function DrawCircle3() {
            var centerX:Number = 250;
            var centerY:Number = 350;
            var r:Number = 100;
                
            graphics.lineStyle(2, 0xFF0006);
            graphics.moveTo(centerX+r, centerY);
                
            graphics.curveTo(r+centerX, Math.tan(Math.PI/8)*r+centerY, Math.sin(Math.PI/4)*r+centerX,
            Math.sin(Math.PI/4)*r+centerY);
            graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, r+centerY, centerX, r+centerY);
            graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, r+centerY, -Math.sin(Math.PI/4)*r+centerX,
            Math.sin(Math.PI/4)*r+centerY);
            graphics.curveTo(-r+centerX, Math.tan(Math.PI/8)*r+centerY, -r+centerX, centerY);
            graphics.curveTo(-r+centerX, -Math.tan(Math.PI/8)*r+centerY, -Math.sin(Math.PI/4)*r+centerX,
            -Math.sin(Math.PI/4)*r+centerY);
            graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, -r+centerY, centerX, -r+centerY);
            graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, -r+centerY, Math.sin(Math.PI/4)*r+centerX,
            -Math.sin(Math.PI/4)*r+centerY);
            graphics.curveTo(r+centerX, -Math.tan(Math.PI/8)*r+centerY, r+centerX, centerY);
            
        }
    }
}