forked from: 【wonderfl本】curveTo
forked from 【wonderfl本】curveTo (diff: 4)
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);
}
}
}