Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Chris M. Thomasson" Newsgroups: comp.lang.javascript Subject: Re: An online circle intersection fractal... Date: Mon, 4 Nov 2013 14:01:19 -0800 Organization: Aioe.org NNTP Server Lines: 86 Message-ID: References: <935bd61f-b8bd-456a-8813-3b00b2ebddb4@googlegroups.com> NNTP-Posting-Host: PomiWpvG4e2y0HvOhU0dhw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Windows Live Mail 15.4.3555.308 Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com comp.lang.javascript:21896 > "Michael Haufe (TNO)" wrote in message news:935bd61f-b8bd-456a-8813-> > 3b00b2ebddb4@googlegroups.com... > On Saturday, November 2, 2013 3:43:00 PM UTC-5, Chris M. Thomasson wrote: > > The fractal is simple. Find circle intersections, draw circles at those > > points, > > then find all of the newly generated intersections, and repeat... You > > can > > create some pretty nice fractals that way. Also, it seems as if circle > > inter- > > sections can be used for other applications as well... > First off, I'm glad to see some more fractal applications > being displayed. Thank you. > Being able to pass in the settings > through url arguments would be a nice addition I think. 100% agreed! :^) > > I was wondering if my code is total crap or not. Please, any advise > > would be > > extremely beneficial. I just hope it does not involve a complete > > rewrite. > > Luckily, this software is in pre-alpha stages: > The fact that you can produce significant results in a > timely manner demonstrates that it wouldn't fall under > "total crap" imo. One must be wary of letting the best > be the enemy of the good. > While I've yet to take much time looking at it yet, my > first thought is to whether using polar coordinates instead > of Cartesian would make things clearer or not. So thinking > out loud here: A circle in cartesian "x^2 + y^2 = 1" becomes > "r = 1" in polar. So while the representations are far > simpler, the intersection can be a bit more difficult as > there are infinite equivalent answers. IMVHO, the algorihtm as-is is fairly nice because it solves for the intersection(s) of two circles using only a single sqrt operation. So far, this is pretty good when compared to most of the other soultions I have seen that rely on more than one sqrt and/or trig functions. 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! ;^) > A requestAnimationFrame wrapper I prefer to use currently: > window.requestAnimFrame = (function(){ > return window.requestAnimationFrame || > window.webkitRequestAnimationFrame || > window.mozRequestAnimationFrame || > window.oRequestAnimationFrame || > window.msRequestAnimationFrame || > function(run){ > window.setTimeout(run, 16); > }; > })(); > Also, I'm quite certain it will be a bit faster to render > against the canvas image data instead of using the API. > You'll have to roll your own circle drawing routine, but > since this is a labor of love, I suspect you might not > mind for the performance boost. > clearRect(...) on the entire display can be slow. Do this instead: > myCanvas.width = myCanvas.width > More thoughts to come as time permits Thank you for all of the suggestions Michael. I really do appreaciate the fact that you give a damn about fractals! ;^)