实际上as3 math.sin是如何工作的?功能与科学计算器相同吗? [英] How actually as3 math.sin works? is function same with scientific calculator ?
问题描述
你好大家
实际上math.sin()如何在as3中工作?
我对我得到的结果感到困惑
i尝试跟踪(math.sin(180))
实际上我应该是0,
但是我得到-0.8011526357338304
我也尝试跟踪(math.sin(90))
它应该是1
但是我得到了0.8939966636005579
和一些价值是负的(正如我对正弦计算的理解,价值在0 - 179之间应该是积极的)
有人可以纠正我的错误吗?
我尝试了什么:
i试用这段代码
trace(数学。罪(180))
结果是-0.8011526357338304
除了math.sin(0)
你得到这样的结果,因为sin
方法参数应该是gi在弧度 [ ^ ]当你使用学位时。
试试,例如
trace (Math.sin(度* Math.PI / 180 ))
请参阅:数学 - Adobe ActionScript 3(AS3)API参考 [ ^ ]。
hello everyone
how actually math.sin() works in as3??
i'm confuse with the result i got
i try to trace(math.sin( 180 ))
in reality i should be 0,
but i got -0.8011526357338304
and i also try trace(math.sin(90))
it should be 1
but i got 0.8939966636005579
and some of the value was negative ( as what i understand about calcuation of sine , value in between 0 - 179 should be postive )
can someone pls correct my mistake ?
What I have tried:
i have try this code
trace(math.sin(180))
result was -0.8011526357338304
and other value was incorrect besides math.sin(0)
You get such a result because thesin
method argument is supposed to be given in radians[^] while you are using degrees.
Try, for instance
trace( Math.sin( degrees * Math.PI / 180 ))
这篇关于实际上as3 math.sin是如何工作的?功能与科学计算器相同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!