Trigonometric functions: Difference between revisions
Pop11: Fixed formatting. Perl 6: Added.
Underscore (talk | contribs) (→{{header|Perl}}: Changed to use print variadically instead of building up the input through concatenation. Added "my"s.) |
Underscore (talk | contribs) (Pop11: Fixed formatting. Perl 6: Added.) |
||
Line 695:
0.785398163397448 45
</pre>
=={{header|Perl 6}}==
{{works with|Rakudo|#22 "Thousand Oaks"}}
<lang perl6>say sin(pi/3), ' ', sin 60, 'd'; # 'g' (gradians) and 1 (circles)
say cos(pi/4), ' ', cos 45, 'd'; # are also recognized.
say tan(pi/6), ' ', tan 30, 'd';
say asin(sqrt(3)/2), ' ', asin sqrt(3)/2, 'd';
say acos(1/sqrt 2), ' ', acos 1/sqrt(2), 'd';
say atan(1/sqrt 3), ' ', atan 1/sqrt(3), 'd';</lang>
=={{header|Pop11}}==
Pop11 trigonometric functions accept both degrees and radians. In default mode argument is in degrees, after setting 'popradians' flag to 'true' arguments are in radians.
<lang pop11>sin(30) =>
cos(45) =>
tan(45) =>
Line 717 ⟶ 725:
arcsin(0.7) =>
arccos(0.7) =>
arctan(0.7) =></lang>
=={{header|Python}}==
|