> "Dr J R Stockton" wrote in message news:>
> +SUJPfoY...@invalid.uk.co.demon.merlyn.invalid...
> In comp.lang.javascript message <34ae1ec8-f301-4a46-bdc1-f2c2be3d7d4a@go
>
oglegroups.com>, Mon, 4 Nov 2013 18:40:13, "Michael Haufe (TNO)"
> <
t...@thenewobjective.com> posted:
> >On Monday, November 4, 2013 4:01:19 PM UTC-6, Chris M. Thomasson wrote:
> >>
> >> Do you happen have something in mind that can find the true
> >> intersection(s)
> >> of two circles that gets around any sqrt wrt polar coordinates? I am
> >> all
> >> ears if you have something to share! ;^)
[...]
> >when you draw the circle on the pixel array, you can look at the color
> >of the current pixel before you plot the point. So if the default color
> >of the canvas is white, and circles are black when plotted, the
> >intersection of the current circle and ALL of the relevant circles in
> >the region would be where the pixel is already black.
> As I understand it, the desire is to show a fractal based on exact
> circles positioned in the exact intersections of exact circles, which
> would require infinite-length arithmetic.
> The OP's code would replace exact arithmetic with IEEE Doubles
> arithmetic, resolution about 1 in 7E15, which is likely to be good
> enough.
Yes, it is definitely good enough for the application at hand.
:^)
> Your idea rounds the points of intersection to be integers in pixel
> units; and that may not be good enough.
Its an interesting idea about finding intersections. I was thinking about
encoding the circles with unique colors and extending the fractal
based of of that information. The problem is, the "seed circles" might
be off the viewport plane when I zoom. I need to calculate that
information in order to get to the part that is within the viewport.
So, there comes a point where using pixel information to determine
intersections is more expensive than simply calculating them. In
other words, when you do not have to draw, calculate the intersections.
Humm...
> Additionally, one must consider
> the possible cases of tangency and of almost-parallel intersection,
> where many pixels may "lie on" both lines.
Exactly right. I was worried about two circles passing right through
each other when the pixels are diagonal. I was thinking about
encoding a unique color for each circle. Then this diagonal issue
can be solved by doing a little search around the 8 pixels
surrounding the current pixel.
> I recall the esteemed Fred, Head of Workshop, consulting me about a cam-
> shape calculation which was going astray. He prudently had tested it
> using a graph-plotter before using the nice new numerically-controlled
> milling-machine, and I was able to perceive that his code had
> substantially that problem, easily enough avoided once realised.
There will be errors in the pixel probing solution proportionate to
rounding errors.
AFAICT, the error should actually be visually represented in the fractal
itself. Interesting to compare a rendering generated by the pixel
probe vs. one generated by the actual circle intersection calculation...
Fractals are _very_ sensitive to any errors...
;^)
Thanks.