“LlAcos”的版本间的差异

来自人工智能助力教育知识百科
跳转至: 导航搜索
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {|border="1" |+函数详情 |- |函数名 |Function: float llAcos( float val ); |- |参数 |float…”)
 
Mkx讨论 | 贡献
第1行: 第1行:
 
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}
 
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}
  
{|border="1"
 
|+函数详情
 
|-
 
|函数名
 
|Function: float llAcos( float val );
 
|-
 
|参数
 
|float val –must fall in the range [-1.0, 1.0]
 
|-
 
|返回值
 
|Returns a float that is the arccosine in radians of val
 
|}
 
  
|注意事项
+
{{函数详情
<pre>
+
|函数名=Function: float llAcos( float val );
+
|参数= 参数:float val –must fall in the range [-1.0, 1.0]
</pre>
+
|返回值= 返回值:Returns a float that is the arccosine in radians of val.
 +
 
 +
 
 +
|注意事项=
  
|示例
 
  
 +
|示例=
 +
示例1
 
<pre>
 
<pre>
示例1
 
 
//  This example exercises the full valid range of argument from -1.0 to +1.0
 
//  This example exercises the full valid range of argument from -1.0 to +1.0
 
   
 
   
第53行: 第44行:
 
</pre>
 
</pre>
  
|相关函数
+
|相关函数=
*[[llSin]] [[llAsin]] –sine & inverse Sine
+
[[llSin]] [[llAsin]] –sine & inverse Sine
*[[llCos]] –cosine
+
[[llCos]] –cosine
*[[llTan]] [[llAtan2]] –tangent & inverse tangent
+
[[llTan]] [[llAtan2]] –tangent & inverse tangent
 +
}}

2020年2月27日 (四) 07:32的版本

Template:Needs Translation/


函数名
Function: float llAcos( float val );
参数:float val –must fall in the range [-1.0, 1.0]
返回值:Returns a float that is the arccosine in radians of val.
注意事项
示例
示例1
//  This example exercises the full valid range of argument from -1.0 to +1.0
 
default
{
    touch_start(integer num_detected)
    {
        float random = llFrand(2.0) - 1.0;
 
        llOwnerSay("The arccosine of " + (string)random + " is " + (string)llAcos(random));
    }
}

示例2

//An example for the Law of Cosines to calculate any angle of a triangle from 3 known side lengths.
 
default
{
    touch_start(integer num_detected)
    {        
        vector t=< llFrand(9.0)+1.0 , llFrand(9.0)+1.0 , llFrand(9.0)+1.0 >; //the 3 values of this vector are used to set the lengths of 3 sides of a triangle.
 
        float anglexy=llAcos( (t.x*t.x+t.y*t.y-(t.z*t.z)) / ( 2*t.x*t.y) ) //Law Of Cosines
 
        llOwnerSay("Using the Law Of Cosines, the angle of a triangle between side a="+(string)t.x+"and side b="+(string)t.y+"is = "+(string)anglexy+" radians="+(string)(anglexy*RAD_TO_DEG)+"° and that angle is not on side c="+(string)t.z);
    }
}
相关函数
llSin llAsin –sine & inverse Sine

llCos –cosine llTan llAtan2 –tangent & inverse tangent

相关事件