【发布时间】:2011-04-22 07:47:38
【问题描述】:
嘿,偷看, 我得到了这个代码:
red = red + 1;
trace("red: " + red);
trace("Math.sin(red): " + Math.sin(red));
var newRed:uint = Math.abs(Math.sin(red)) * 255;
trace("newRed: " + newRed);
此代码输出以下内容:
red: 256
Math.sin(red): -0.9992080341070627
newRed: 254
red: 257
Math.sin(red): -0.5733571748155426
newRed: 146
red: 258
Math.sin(red): 0.37963562682930313
newRed: 96
red: 259
Math.sin(red): 0.9835931839466808
newRed: 250
等等
当我将 sin(257) 插入计算器时,我得到 -0.974370064785235,但 Flash 给出 -0.5733571748155426
编辑:-
但是,当我插入 sin(256) 时,我从每个中得到相同的数字。这让我很困惑。
我有点困惑为什么会这样。请帮忙。 亚历克斯
【问题讨论】:
-
查看 user492238 的回答。这很可能是问题所在:help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/…。如有疑问,请使用 RTFM。 :)
-
另请注意,该页面顶部存在用于在弧度和度数之间转换的公式。
标签: flash math trigonometry