El 20 de abril de 2010 08:25, Andrew Reilly
<areilly@bigpond.net.au> escribió:
Sorry for coming in late!
I don't think that your C program is doing what you thing it should be. Certainly not
what your list-based scheme program is. Specifically, the array indexing in :
for (j=0; j< size_y; j++) {
for (i=0; i< size_x; i++) {
p.x = i;
p.y = j;
dist = distance_point_point(&p, &refp);
if ( dist > 255 ) {
block[i*j] = 255;
} else {
block[i*j] = dist;
}
}
}
should probably be block[j*size_x + i]. What you have there is
only setting a very limited subset of the elements of the array.
Cheers,
--
Andrew
Yes you are right about that and I realized later. I wrote that stuff very quickly just to measure times. I made the same mistake in the scheme code also IRCC :)
Thanks for you reply!
Álvaro