Trigonometric functions: Difference between revisions

Content added Content deleted
(added Clojure)
(added PowerShell)
Line 760: Line 760:
arccos(0.7) =>
arccos(0.7) =>
arctan(0.7) =></lang>
arctan(0.7) =></lang>

=={{header|PowerShell}}==
{{Trans|C}}
<lang powershell>$rad = [Math]::PI / 4
$deg = 45
'{0,10} {1,10}' -f 'Radians','Degrees'
'{0,10:N6} {1,10:N6}' -f [Math]::Sin($rad), [Math]::Sin($deg * [Math]::PI / 180)
'{0,10:N6} {1,10:N6}' -f [Math]::Cos($rad), [Math]::Cos($deg * [Math]::PI / 180)
'{0,10:N6} {1,10:N6}' -f [Math]::Tan($rad), [Math]::Tan($deg * [Math]::PI / 180)
$temp = [Math]::Asin([Math]::Sin($rad))
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)
$temp = [Math]::Acos([Math]::Cos($rad))
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)
$temp = [Math]::Atan([Math]::Tan($rad))
'{0,10:N6} {1,10:N6}' -f $temp, ($temp * 180 / [Math]::PI)</lang>
Output:
<pre> Radians Degrees
0,707107 0,707107
0,707107 0,707107
1,000000 1,000000
0,785398 45,000000
0,785398 45,000000
0,785398 45,000000</pre>


=={{header|Python}}==
=={{header|Python}}==