Difference between revisions of "LlTan"

From Second Life Wiki
Jump to navigation Jump to search
m (LlTan moved to LSL llTan)
 
(13 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 radians.
        llOwnerSay("The tangent of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llTan(r));
{|  
    }
|-
}</source>
| [[LSL_Energy|Energy]]:
|helpers
| 10.0
|also_functions=
|-
{{LSL DefineRow|[[llSin]]|[[llAsin]]|sine & inverse Sine}}
| [[LSL_Sleep|Sleep]]:
{{LSL DefineRow|[[llCos]]|[[llAcos]]|cosine & inverse cosine}}
| 0.0
{{LSL DefineRow||[[llAtan2]]|inverse tangent}}
|-
|also_events
| [[LSL_Function_ID|Function ID]]:
|also_articles
| 2
|also_tests
|}
|notes
</div>
|cat1=Math/Trigonometry
</div>
|cat2
|-
|cat3
|
|cat4
<div id="box">
}}
 
== Caveats ==
<div style="padding: 0.5em">
</div>
</div>
 
|-
|
<div id="box">
== Examples ==
<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">
</div>
</div>
|}
 
[[Category:LSL_Functions]]
[[Category:LSL_Math]]

Latest revision as of 14:40, 14 September 2015

Summary

Function: float llTan( float theta );

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

All Issues ~ Search JIRA for related Bugs

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

Search JIRA for related Issues

Signature

function float llTan( float theta );