Bitmap/Bresenham's line algorithm: Difference between revisions

→‎{{header|Perl 6}}: more style tweaks
(→‎{{header|Perl 6}}: replaced 'delta' by 'Δ')
(→‎{{header|Perl 6}}: more style tweaks)
Line 1,067:
my $error = 0;
my $Δerror = $Δy / $Δx;
my $ystepy-step = $y0 < $y1 ?? 1 !! -1;
my $y = $y0;
for $x0 .. $x1 -> $x {
Line 1,077:
$error += $Δerror;
if $error >= 0.5 {
$y += $y + $ystep-step;
$error = $error -= 1.0;
}
}
Anonymous user