Length of an arc between two angles: Difference between revisions

Content added Content deleted
(J draft)
(added Arturo)
Line 169: Line 169:
<pre> 10 arc 10 120
<pre> 10 arc 10 120
43.6332313</pre>
43.6332313</pre>

=={{header|Arturo}}==

<syntaxhighlight lang="arturo">degToRad: function [deg]-> deg * pi // 180
radToDeg: function [rad]-> rad * 180 // pi

doublePi: 2 * pi

arcLength: function [r, a, b][
d: (abs a-b) % doublePi
return r * (d >= pi)? -> d -> doublePi - d
]

print ["Arc length:" to :string .format:".5f" arcLength 10 degToRad 10.0 degToRad 120.0]</syntaxhighlight>

{{out}}

<pre>Arc length: 43.63323</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==