Math.cos(angle*Math.PI/180)の誤差
/**
* Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/4I9N
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
[SWF(backgroundColor="#FFFFFF", width="465", height="465", frameRate="30")]
public class Main extends Sprite {
public function Main() {
//Wonderfl.capture_delay(1);
init();
}
private function init():void {
var txt1:TextField = new TextField();
addChild(txt1);
txt1.x = 10;
txt1.y = 10;
txt1.width = 445;
txt1.text = "Math.cos(0*Math.PI/180)\r" + String(Math.cos(0*Math.PI/180));
var txt2:TextField = new TextField();
addChild(txt2);
txt2.x = 10;
txt2.y = 60;
txt2.width = 445;
txt2.text = "Math.cos(90*Math.PI/180)\r" + String(Math.cos(90*Math.PI/180));
var txt3:TextField = new TextField();
addChild(txt3);
txt3.x = 10;
txt3.y = 110;
txt3.width = 445;
txt3.text = "Math.cos(180*Math.PI/180)\r " + String(Math.cos(180*Math.PI/180));
var txt4:TextField = new TextField();
addChild(txt4);
txt4.x = 10;
txt4.y = 160;
txt4.width = 445;
txt4.text = "Math.cos(270*Math.PI/180)\r" + String(Math.cos(270*Math.PI/180));
var txt5:TextField = new TextField();
addChild(txt5);
txt5.x = 10;
txt5.y = 210;
txt5.width = 445;
txt5.text = "Math.cos(360*Math.PI/180)\r" + String(Math.cos(360*Math.PI/180));
var txt6:TextField = new TextField();
addChild(txt6);
txt6.x = 10;
txt6.y = 260;
txt6.width = 445;
txt6.text = "Math.round(Math.cos(90*Math.PI/180)*Math.pow(10,15))/Math.pow(10,15)\r" + String(Math.round(Math.cos(90*Math.PI/180)*Math.pow(10,15))/Math.pow(10,15));
var txt7:TextField = new TextField();
addChild(txt7);
txt7.x = 10;
txt7.y = 310;
txt7.width = 445;
txt7.text = "Math.round(Math.cos(270*Math.PI/180)*Math.pow(10,15))/Math.pow(10,15)\r" + String(Math.round(Math.cos(270*Math.PI/180)*Math.pow(10,15))/Math.pow(10,15));
}
}
}