【wonderfl本】curveTo
♥0 |
Line 24 |
Modified 2009-12-16 22:38:22 |
MIT License
archived:2017-03-10 05:30:28
ActionScript3 source code
/**
* Copyright Knuckle ( http://wonderfl.net/user/Knuckle )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/xJEl
*/
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);
}
}
}