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

curverToを使って円を描く

大変だったwww
Get Adobe Flash player
by UKI0809 18 Jan 2011
    Embed
/**
 * Copyright UKI0809 ( http://wonderfl.net/user/UKI0809 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/bero
 */

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,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);
        
        }

    }

}