Difference between revisions of "LlTan"

From Second Life Wiki
Jump to navigation Jump to search
 
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lowercase|llTan}}
{{LSL_Function
__NOTOC__
|inject-2={{LSL_Function/angle|theta}}
 
|func=llTan|sort=Tan
{| width="100%"
|func_id=2|func_sleep=0.0|func_energy=10.0
|-
|func_footnote
|<div id="box">
|p1_type=float|p1_name=theta
== [[LSL_Type_float|float]] llTan( [[LSL_Type_float|float]] theta); ==
|return_type=float
<div style="padding: 0.5em">
|return_text=that is the tangent of {{LSLP|theta}}.
* theta - theta in radians.
|spec
</div>
|caveats=Because of IEE754 on floats , llTan(PI_BY_TWO) returns -22877332 ( hex: 0xCBAE8A4A) and not infinity
</div>
|constants
|-
|examples=<source lang="lsl2">// Touch the object with this script in it to see the tangent of random numbers!
|
default
<div id="box">
{
 
    touch_start(integer num)
== Specification ==
    {
<div style="padding: 0.5em">
        float r = llFrand(TWO_PI);
Returns the tangent of theta.
        llOwnerSay("The tangent of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llTan(r));
</div>
    }
</div>
}</source>
|-
|helpers
|
|also_functions=
<div id="box">
{{LSL DefineRow|[[llSin]]|[[llAsin]]|sine & inverse Sine}}
 
{{LSL DefineRow|[[llCos]]|[[llAcos]]|cosine & inverse cosine}}
== Caveats ==
{{LSL DefineRow||[[llAtan2]]|inverse tangent}}
<div style="padding: 0.5em">
|also_events
</div>
|also_articles
</div>
|also_tests
 
|notes
|-
|cat1=Math/Trigonometry
|
|cat2
<div id="box">
|cat3
== Examples ==
|cat4
<div style="padding: 0.5em">
}}
<lsl>
</lsl>
</div>
</div>
|-
|
<div id="box">
== Helper Functions ==
<div style="padding: 0.5em">
<lsl>
</lsl>
</div>
</div>
|-
|
<div id="box">
== See Also ==
<div style="padding: 0.5em">
</div>
</div>
|-
|
<div id="box">
== Notes ==
<div style="padding: 0.5em">
Function ID: 2
</div>
</div>
|}
 
[[Category:LSL_Functions]]
[[Category:LSL_Math]]

Latest revision as of 13:40, 14 September 2015

Summary

Function: float llTan( float theta );
0.0 Forced Delay
10.0 Energy

Returns a float that is the tangent of theta.

• float theta angle expressed in radians

Caveats

Because of IEE754 on floats , llTan(PI_BY_TWO) returns -22877332 ( hex: 0xCBAE8A4A) and not infinity

Examples

// Touch the object with this script in it to see the tangent of random numbers!
default
{
    touch_start(integer num)
    {
        float r = llFrand(TWO_PI);
        llOwnerSay("The tangent of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llTan(r));
    }
}

See Also

Functions

• llSin llAsin sine & inverse Sine
• llCos llAcos cosine & inverse cosine
•  llAtan2 inverse tangent

Deep Notes

Signature

function float llTan( float theta );