dx = i*g + g/2 - c->source[k].x;
dy = j*g + g/2 - c->source[k].y;
dist = sqrt(dx*dx + dy*dy); /* what's the performance penalty here? */
dx = i*g + g/2 - c->source[k].x;
dy = j*g + g/2 - c->source[k].y;
dist = sqrt(dx*dx + dy*dy); /* what's the performance penalty here? */