LlCos

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

Template:Needs Translation/


函数名
Function: float llCos( float theta );
参数: float theta – angle expressed in radians(以弧度表示的浮动θ角)
返回值:返回一个浮点数,它是θ的余弦
注意事项
因为 iee754在 single floats 上,llcos (pi by two)返回-4.371139 e-8(hex: 0x33bbd2e)而不是0; llcos (pi / 3.0)返回0.49999997(hex: 0x3effff)而不是0
示例
// Touch the object with this script in it to see the cosine of random numbers!
default
{
    touch_start(integer num)
    {
        float r = llFrand(TWO_PI);
        llOwnerSay("The cosine of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llCos(r));
    }
}
相关函数
llSin llAsin-正弦和反正弦 llAcos-反余弦 llTan llAtan2-正切与反正切
相关事件