LlSin

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: float llSin( float theta );
参数:•浮动θ–以弧度表示的角度
返回值:返回θ的正弦值的浮点值。
注意事项
由于浮点上的IEE754,llSin(PI)返回-8.742278E-8(十六进制:0xB3BBBD2E),而不是0.0。误差以PI的倍数累加:例如llSin(100000.0*PI)=0.015890,结果应该是0.0
示例
示例1
// Touch the object with this script in it to see the sine of random numbers!
default
{
    touch_start(integer num)
    {
        float r = llFrand(TWO_PI);
        llOwnerSay("The sine of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llSin(r));
    }
}
相关函数
llAsin–反正弦

llCos llAcos–余弦和反余弦

llTan llAtan2 –正切和反切线

相关事件