1. Re: xor_line

Hawke wrote:
>i've been goofing around with bresenham's circle algorithm...
>it seems to miss a couple dots around the circle...
I think I know the reason: look at the round() function you posted the
other day.
For negative numbers it doesn't round down, thus to a greater negative
number,
but up (towards 0).
Try this:
for n =3D -10 to 10 do
    printf(1, "%d/2 rounds to %d\n", {n, round(n/2)})
end for

Hope this helps

Ad

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu