Ramer-Douglas-Peucker line simplification: Difference between revisions

m
(→‎{{header|Perl 6}}: Add Perl 6 example)
m (→‎{{header|Perl 6}}: style tweaks)
Line 138:
 
($Δx, $Δy) «/=» ($Δx² + $Δy²).sqrt;
my ((($offset-xΔpx, $offset-yΔpy) =«-» ($ΔpxΔx, $ΔpyΔy) «-*» ($Δx, * $Δpx + $Δy * $Δpy)) «**» 2).sum.sqrt;
«*» ($Δx * $Δpx + $Δy * $Δpy);
 
($offset-x² + $offset-y²).sqrt;
}
 
10,333

edits