<br><div class="gmail_quote">El 20 de abril de 2010 08:25, Andrew Reilly <span dir="ltr"><<a href="mailto:areilly@bigpond.net.au">areilly@bigpond.net.au</a>></span> escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Sorry for coming in late!<br>
<br>
I don't think that your C program is doing what you thing it should be. Certainly not<br>
what your list-based scheme program is. Specifically, the array indexing in :<br>
<br>
for (j=0; j< size_y; j++) {<br>
for (i=0; i< size_x; i++) {<br>
p.x = i;<br>
p.y = j;<br>
dist = distance_point_point(&p, &refp);<br>
if ( dist > 255 ) {<br>
block[i*j] = 255;<br>
} else {<br>
block[i*j] = dist;<br>
}<br>
}<br>
}<br>
<br>
should probably be block[j*size_x + i]. What you have there is<br>
only setting a very limited subset of the elements of the array.<br>
<br>
Cheers,<br>
<br>
--<br>
<font color="#888888">Andrew<br>
</font></blockquote></div><div><br></div><div><br></div><div>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 :)</div>
<div><br></div><div>Thanks for you reply!</div><div><br></div><div>Álvaro</div><div><br></div>