Core Function ACos
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> ACos( <expression> ) </pre> === Description === Calculates the arcCosine of a number. === Parameters === ==== expression ==== Any value between -1 and 1 inclusive. ==...") |
(→Example) |
||
Line 24: | Line 24: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
− | $x = ACos(0.5) | + | $x = ACos(0.5); |
− | $radToDeg = 180 / @PI | + | $radToDeg = 180 / @PI; |
− | $y = ACos(-1) * $radToDeg | + | $y = ACos(-1) * $radToDeg; |
− | println( "Value is: $y " ) ;arcCosine of -1 returns 180° | + | println( "Value is: $y " ); //arcCosine of -1 returns 180° |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 21:37, 16 November 2011
ACos( <expression> )
Contents |
Description
Calculates the arcCosine of a number.
Parameters
expression
Any value between -1 and 1 inclusive.
Return Value
Returns the trigonometric arccosine of expression. Result is in radians.
Remarks
ACos(x) is mathematically defined only for -1 < x < 1, so ACos tends to return NaN for other values of x.
Example
$x = ACos(0.5); $radToDeg = 180 / @PI; $y = ACos(-1) * $radToDeg; println( "Value is: $y " ); //arcCosine of -1 returns 180°