forked from: 【wonderfl本】curveTo

by hacker_48mty0q5 forked from 【wonderfl本】curveTo (diff: 1)
♥0 | Line 24 | Modified 2010-01-15 18:34:21 | MIT License
play

ActionScript3 source code

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

// forked from Knuckle's 【wonderfl本】curveTo
package {
    import flash.display.Sprite;
    public class DrawCircle3 extends Sprite {
        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.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);
            
        }
    }
}

Forked