Content deleted Content added
m →Algorithm: Remove unused round() function, no longer needed after endpoint fix. |
→Algorithm: Replaced ipart() with floor() to avoid ambiguity around rounding. |
||
Line 21:
function plot(x, y, c) is
plot the pixel at (x, y) with brightness c (where 0 ≤ c ≤ 1)
// fractional part of x
function fpart(x) is
return x -
function rfpart(x) is
Line 59 ⟶ 55:
xgap := 1 - (x0 - xend)
xpxl1 := xend // this will be used in the main loop
ypxl1 :=
if steep then
plot(ypxl1, xpxl1, rfpart(yend) * xgap)
Line 74 ⟶ 70:
xgap := 1 - (xend - x1)
xpxl2 := xend //this will be used in the main loop
ypxl2 :=
if steep then
plot(ypxl2 , xpxl2, rfpart(yend) * xgap)
Line 87 ⟶ 83:
for x from xpxl1 + 1 to xpxl2 - 1 do
begin
plot(
plot(
intery := intery + gradient
end
Line 94 ⟶ 90:
for x from xpxl1 + 1 to xpxl2 - 1 do
begin
plot(x,
plot(x,
intery := intery + gradient
end
|