Trigonometric functions: Difference between revisions

Content added Content deleted
(Added Wren)
(→‎{{header|Raku}}: add calculation in degrees as required by the task)
Line 4,068: Line 4,068:


=={{header|Raku}}==
=={{header|Raku}}==
(formerly Perl 6) Borrow the degree to radian routine from [https://rosettacode.org/wiki/Length_of_an_arc_between_two_angles#Raku here].
(formerly Perl 6)
{{works with|Rakudo|2016.01}}
{{works with|Rakudo|2020.12}}
<lang perl6># 20210212 Updated Raku programming solution


sub postfix:<°> (\ᵒ) { ᵒ × τ / 360 }
<lang perl6>say sin(pi/3);
say cos(pi/4);
say tan(pi/6);


sub postfix:<㎭🡆°> (\ᶜ) { ᶜ / π × 180 }
say asin(sqrt(3)/2);

say acos(1/sqrt 2);
say atan(1/sqrt 3);</lang>
say sin π/3 ;
say sin 60° ;

say cos π/4 ;
say cos 45° ;

say tan π/6 ;
say tan 30° ;

( asin(3.sqrt/2), acos(1/sqrt 2), atan(1/sqrt 3) )».&{ .say and .㎭🡆°.say }</lang>
{{out}}
<pre>
0.8660254037844386
0.8660254037844386
0.7071067811865476
0.7071067811865476
0.5773502691896257
0.5773502691896257
1.0471975511965976
60
0.7853981633974484
45.00000000000001
0.5235987755982989
30.000000000000004
</pre>


=={{header|RapidQ}}==
=={{header|RapidQ}}==