Length of an arc between two angles: Difference between revisions

Content added Content deleted
Line 123: Line 123:
@show arclength(10, 10, 120) # --> arclength(10, 10, 120) = 43.63323129985823
@show arclength(10, 10, 120) # --> arclength(10, 10, 120) = 43.63323129985823
</lang>
</lang>

=={{header|Kotlin}}==
{{trans|Go}}
<lang scala>import kotlin.math.PI
import kotlin.math.abs

fun arcLength(radius: Double, angle1: Double, angle2: Double): Double {
return (360.0 - abs(angle2 - angle1)) * PI * radius / 180.0
}

fun main() {
val al = arcLength(10.0, 10.0, 120.0)
println("arc length: $al")
}</lang>
{{out}}
<pre>arc length: 43.63323129985823</pre>


=={{header|Perl}}==
=={{header|Perl}}==