RosettaCodeData/Task/Comments/Raku/comments-6.raku
2023-07-01 13:44:08 -04:00

9 lines
283 B
Raku

#| Compute the distance between two points in the plane.
sub distance(
Rat \x1, #= First point's abscissa,
Rat \y1, #= First point's ordinate,
Rat \x2, #= Second point's abscissa,
Rat \y2, #= Second point's ordinate,
){
return sqrt((x2 - x1)**2 + (y2 - y1)**2)
}