マッハの卵、比較
forked from マッハの卵 (diff: 14)
ゲシュタルト心理学においては、運動の解釈は変化の少ない方向に知覚されやすい。すなわち、楕円上の点が回転する速度>楕円上の点が放射状に伸縮する速度 のときに楕円の回転は非剛体運動と知覚されうる。計算上の境目は短半径:長半径=1:1+√2。アニメーションは左からそれぞれ、1.2、1.5、2、1+√2
ActionScript3 source code
/**
* Copyright freddy ( http://wonderfl.net/user/freddy )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/p1e6
*/
// forked from freddy's マッハの卵
package {
import flash.display.Shape;
import flash.events.Event;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
function createEgg(a:Number, x:int):Sprite {
var sp:Sprite = new Sprite();
sp.graphics.lineStyle(1);
var h:int = 100;
var w:int = 100 * a;
sp.graphics.drawEllipse(-w / 2, -h / 2, w, h);
sp.x = x;
sp.y = 200;
sp.addEventListener(Event.ENTER_FRAME, function (e:Event):void {
sp.rotation += 10;
});
return sp;
}
this.addChild(createEgg(1.2, 100));
this.addChild(createEgg(1.5, 300));
this.addChild(createEgg(2, 500));
this.addChild(createEgg(1 + Math.SQRT2, 800));
this.scaleX = this.scaleY = 0.5;
}
}
}
