in reply to Re: Creating a circle in a data structure
in thread Creating a circle in a data structure
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Creating a circle in a data structure
by BrowserUk (Patriarch) on May 29, 2007 at 03:50 UTC | |
Try this. I'm not certain it's exactly equivalent to your original as I had some trouble understanding your 'drawing' code, but it's not far off. Your use of %curpass confused me as it seems unnecessary. You should be able to relate the sub genEndPoints() to the code at the end of the page I linked above. Rather than generating all the points on the circumference for all integer radii upto max radius, it generates only the endpoints (8 at a time using symmetry), of the raster lines required to 'fill' the circle and then draws those lines. Let me know if anything is unclear.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
by AK108 (Friar) on May 29, 2007 at 04:32 UTC | |
My use of %curpass earlier was to ensure that any pixel in the original circle didn't get ++'d twice for the same circle entry. | [reply] [d/l] [select] |
by BrowserUk (Patriarch) on May 29, 2007 at 22:00 UTC | |
That color-codes the center going out (and would go to the edge of the circle, if I had enough CSS classes). You could use the code from A hierarchy of color (intensity)? to generate your CSS classes to form a Color ramp. Below I've used 256 which seems to strike the best balance between smoothness and rendering speed. I also added cellspacing=0 to the table definition as it much improves the appearance.
Is your purpose to generate the structure and the table graphic is just a way of demonstrating it? Or is the display of the result the real objective? If the latter, it would probably be much faster and use less bandwidth to render to a .png using GD(or similar) and then link the image. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
by AK108 (Friar) on May 29, 2007 at 23:27 UTC |