Trigonometric functions: Difference between revisions
Content added Content deleted
(Scala added) |
(Add Nimrod) |
||
Line 1,432: | Line 1,432: | ||
arctangent| 0.785398163397 | 45.000000000000 | |
arctangent| 0.785398163397 | 45.000000000000 | |
||
</pre> |
</pre> |
||
=={{header|Nimrod}}== |
|||
<lang nimrod>import math |
|||
proc radians(x): float = x * pi / 180 |
|||
proc degrees(x): float = x * 180 / pi |
|||
let rad = pi/4 |
|||
let deg = 45.0 |
|||
echo "Sine: ", sin(rad), " ", sin(radians(deg)) |
|||
echo "Cosine : ", cos(rad), " ", cos(radians(deg)) |
|||
echo "Tangent: ", tan(rad), " ", tan(radians(deg)) |
|||
echo "Arcsine: ", arcsin(sin(rad)), " ", degrees(arcsin(sin(radians(deg)))) |
|||
echo "Arccocose: ", arccos(cos(rad)), " ", degrees(arccos(cos(radians(deg)))) |
|||
echo "Arctangent: ", arctan(tan(rad)), " ", degrees(arctan(tan(radians(deg))))</lang> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |