Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2869 > unrolled thread

A Question About Fractals

Started byBrian <briansipler@yahoo.com>
First post2013-01-19 12:10 -0800
Last post2013-02-19 13:11 -0800
Articles 17 — 6 participants

Back to article view | Back to comp.programming


Contents

  A Question About Fractals Brian <briansipler@yahoo.com> - 2013-01-19 12:10 -0800
    Re: A Question About Fractals Geoff <geoff@invalid.invalid> - 2013-01-19 12:45 -0800
      Re: A Question About Fractals Brian <briansipler@yahoo.com> - 2013-01-19 13:09 -0800
        Re: A Question About Fractals Geoff <geoff@invalid.invalid> - 2013-01-19 14:16 -0800
        Re: A Question About Fractals Robin Vowels <robin.vowels@gmail.com> - 2013-01-19 15:53 -0800
    Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-02-18 15:53 -0800
      Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-02-18 16:36 -0800
        Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-02-20 18:25 -0800
      Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-02-26 02:21 -0800
        Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-03-03 17:59 -0800
          Re: A Question About Fractals luser droog <mijoryx@yahoo.com> - 2013-05-17 18:55 -0700
            Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-05-17 22:27 -0700
        Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-03-04 13:17 -0800
        Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-03-10 18:10 -0700
        Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-03-10 18:21 -0700
    Re: A Question About Fractals James Dow Allen <gmail@jamesdowallen.nospam> - 2013-02-19 17:45 +0000
      Re: A Question About Fractals "Chris M. Thomasson" <no@spam.invalid> - 2013-02-19 13:11 -0800

#2869 — A Question About Fractals

FromBrian <briansipler@yahoo.com>
Date2013-01-19 12:10 -0800
SubjectA Question About Fractals
Message-ID<b3b13a29-514f-43b1-9ca7-03ae8189d635@gu9g2000vbb.googlegroups.com>
Hi, I was reading an article about fractals, and the article says that
fractals by themselves have no shape or form, but that computers can
be used to convert fractals into images.  What exactly is a fractal?

Brian

[toc] | [next] | [standalone]


#2870

FromGeoff <geoff@invalid.invalid>
Date2013-01-19 12:45 -0800
Message-ID<fd1mf8h1rq41p4l9juut2rr4fohelu2t4f@4ax.com>
In reply to#2869
On Sat, 19 Jan 2013 12:10:20 -0800 (PST), Brian <briansipler@yahoo.com> wrote:

>Hi, I was reading an article about fractals, and the article says that
>fractals by themselves have no shape or form, but that computers can
>be used to convert fractals into images.  What exactly is a fractal?
>
>Brian

Hmmm... where on the web might we find a decent description?

http://en.wikipedia.org/wiki/Fractal

[toc] | [prev] | [next] | [standalone]


#2871

FromBrian <briansipler@yahoo.com>
Date2013-01-19 13:09 -0800
Message-ID<a56516f8-2514-4351-9aa1-ebaeb03520dc@g8g2000vbf.googlegroups.com>
In reply to#2870
On Jan 19, 3:45 pm, Geoff <ge...@invalid.invalid> wrote:
> On Sat, 19 Jan 2013 12:10:20 -0800 (PST), Brian <briansip...@yahoo.com> wrote:
> >Hi, I was reading an article about fractals, and the article says that
> >fractals by themselves have no shape or form, but that computers can
> >be used to convert fractals into images.  What exactly is a fractal?
>
> >Brian
>
> Hmmm... where on the web might we find a decent description?
>
> http://en.wikipedia.org/wiki/Fractal

Thank you for the link, Geoff.  The Wikipedia article on fractals
answered my question.

[toc] | [prev] | [next] | [standalone]


#2872

FromGeoff <geoff@invalid.invalid>
Date2013-01-19 14:16 -0800
Message-ID<vn6mf8tfaa2olco1032mqs198k2ta79dce@4ax.com>
In reply to#2871
On Sat, 19 Jan 2013 13:09:35 -0800 (PST), Brian <briansipler@yahoo.com> wrote:

>On Jan 19, 3:45 pm, Geoff <ge...@invalid.invalid> wrote:
>> On Sat, 19 Jan 2013 12:10:20 -0800 (PST), Brian <briansip...@yahoo.com> wrote:
>> >Hi, I was reading an article about fractals, and the article says that
>> >fractals by themselves have no shape or form, but that computers can
>> >be used to convert fractals into images.  What exactly is a fractal?
>>
>> >Brian
>>
>> Hmmm... where on the web might we find a decent description?
>>
>> http://en.wikipedia.org/wiki/Fractal
>
>Thank you for the link, Geoff.  The Wikipedia article on fractals
>answered my question.

You're welcome. As you can see it isn't a very simple answer.

Enjoy.

[toc] | [prev] | [next] | [standalone]


#2873

FromRobin Vowels <robin.vowels@gmail.com>
Date2013-01-19 15:53 -0800
Message-ID<adf696eb-f78f-4a39-bde4-44cc76148c4d@y3g2000pbq.googlegroups.com>
In reply to#2871
On Jan 20, 8:09 am, Brian <briansip...@yahoo.com> wrote:
> On Jan 19, 3:45 pm, Geoff <ge...@invalid.invalid> wrote:
>
> > On Sat, 19 Jan 2013 12:10:20 -0800 (PST), Brian <briansip...@yahoo.com> wrote:
> > >Hi, I was reading an article about fractals, and the article says that
> > >fractals by themselves have no shape or form, but that computers can
> > >be used to convert fractals into images.  What exactly is a fractal?
>
> > >Brian
>
> > Hmmm... where on the web might we find a decent description?
>
> >http://en.wikipedia.org/wiki/Fractal
>
> Thank you for the link, Geoff.  The Wikipedia article on fractals
> answered my question.

The formula for creating images is almost trivial ...

[toc] | [prev] | [next] | [standalone]


#3041

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-02-18 15:53 -0800
Message-ID<kfuetu$msp$1@speranza.aioe.org>
In reply to#2869
"Brian"  wrote in message 
news:b3b13a29-514f-43b1-9ca7-03ae8189d635@gu9g2000vbb.googlegroups.com...

> Hi, I was reading an article about fractals, and the article says that
> fractals by themselves have no shape or form, but that computers can
> be used to convert fractals into images.  What exactly is a fractal?

Self-similarity across various levels of scaling. Think of repeating 
patterns that can curve around and repeat themselves at a slightly lower 
scale until it hits critical limit. Critical limit can be how far you are 
willing to go wrt the infinitely repeating pattern. For instance, a simple 
fractal could be something as simple as finding the points of intersections 
between a set of cirlces. Then simply draw smaller circles around said 
points. Repeat!

FWIW, and since this is comp.programming, here is a retarded first attempt 
at creating such circle intersection fractal, presented in AS3 of course!


__________________________________________________________________________
package
{
    import flash.display.Sprite;
    import flash.events.Event;

    /**
     * ...
     * @author Chris M. Thomasson
     */
    public class Main extends Sprite
    {

        private var mcr1:Number = 3;
        private var mcr2:Number = 3;



        public function
        prv_draw(i:uint, cmp1:Array, cmp2:Array):void {

            if (i > 33 || ! cmp1 || ! cmp2) return;

            //cmp1[2] * 314628
            //.5 / (i / 22)
            // c=(i + 1) * (cmp1[2] * cmp1[2]) * (cmp1[2] * cmp1[2]) * 
314628
            this.graphics.lineStyle(.277 / (i / 22),
                0xFFFF00, .03);
            prv_circle_draw(cmp1, 0);

            if (cmp1 != cmp2)
            {
                //this.graphics.lineStyle(.75 / (i / 22), 0x00FFFF, 1);
                //prv_circle_draw(cmp2, 0);
            }


            var isect1:Array = prv_circle_isect(cmp1, cmp2, 0, 3);


            if (isect1)
            {
               // prv_circle_draw(isect1, 0);


                prv_draw(i + 1, isect1, cmp1);
                prv_draw(i + 1, isect1, cmp2);


                prv_draw(i + 1, cmp1, isect1);
                prv_draw(i + 1, cmp2, isect1);
            }




            /*

            var isect1:Array = prv_circle_isect(cmp1, cmp2, 0, 3);
            var isect2:Array = prv_circle_isect(cmp2, cmp1, 0, 3);

            if (isect1)
            {
                prv_circle_draw(isect1, 0);

                prv_draw(i + 1, cmp1, isect1);
                prv_draw(i + 1, cmp2, isect1);
                prv_draw(i + 1, isect1, cmp1);
                prv_draw(i + 1, isect1, cmp2);
            }

            if (isect2)
            {
                prv_circle_draw(isect2, 0);

                prv_draw(i + 1, cmp1, isect2);
                prv_draw(i + 1, cmp2, isect2);
                prv_draw(i + 1, isect2, cmp1);
                prv_draw(i + 1, isect2, cmp2);
            }

            */
        }



        public function
        Main():void {





            //prv_cdraw_render();

            addEventListener(Event.ENTER_FRAME, prv_cdraw_render);


           /*
           var circles:Array = [
                200, 300, 100,
                250, 300, 100];

           this.graphics.lineStyle(1, 0xFFFFFF);


           //prv_circle_draw(circles, 0);


           //prv_circle_draw(circles, 3);

           //var isect:Array = prv_circle_isect(circles, circles, 0, 3);

           //if (! isect) return;

           var i:uint = 0;

           for (var ci:uint = 0; ci < circles.length && i < 22; ci += 3, 
++i)
           {
               var ci2:uint = ci + 3;
               if (ci2 + 3 > circles.length) break;



               var isect_fresh:Array =
                    prv_circle_isect(circles, circles, ci, ci2);

               if (! isect_fresh) continue; //fixup?

               prv_circle_draw(circles, ci);

               prv_circle_draw(isect_fresh, 0);

               circles = circles.concat(isect_fresh);
           }



           */



           /*

           prv_circle_draw(isect, 0);



           var isect2a:Array = prv_circle_isect(circles, isect, 0, 0);
           var isect2b:Array = prv_circle_isect(isect, circles, 0, 3);


           prv_circle_draw(isect2a, 0);
           prv_circle_draw(isect2b, 0);



           var isect3a:Array = prv_circle_isect(circles, isect2a, 0, 0);
           var isect3b:Array = prv_circle_isect(isect2b, circles, 0, 3);


           prv_circle_draw(isect3a, 0);
           prv_circle_draw(isect3b, 0);


           //isect2:Array = prv_circle_isect(circles, isect, 0, 0);

           */
        }







        public function
        prv_cdraw_render(e5:Event = null):void {
            this.graphics.clear();

            var circles:Array = [
                355, 300, 222,
                555, 300, 177];


            this.graphics.lineStyle(1, 0xFFFFFF, .1);

            this.graphics.drawCircle(circles[0], circles[1], circles[2]);
            this.graphics.drawCircle(circles[3], circles[4], circles[5]);

            prv_draw(0, circles, circles);


            //var circles2:Array = [
            //    200, 100, 333 - mcr2,
            //    444, 100, 333 - mcr2];

            //this.graphics.drawCircle(circles2[0], circles2[1], 
circles2[2]);
            //this.graphics.drawCircle(circles2[3], circles2[4], 
circles2[5]);
                //
              //  prv_draw(0, circles2, circles);

            mcr1 -= .007;
            mcr2 += .17;
        }




        public function
        prv_draw_mid_point_circle(
            circles:Array,
            offset:uint
        ):Array {

            this.graphics.moveTo(circles[0], circles[1]);
            var dis:Number = prv_distance(circles, 0);

            this.graphics.lineStyle(circles[2]);
            this.graphics.lineTo(circles[3], circles[4]);


            this.graphics.moveTo(circles[0], circles[1]);
            this.graphics.lineStyle(circles[5], 0xFFFF00);

            var ggg:Array = prv_mid_point(circles, 0);
            this.graphics.lineTo(ggg[0], ggg[1]);


            this.graphics.lineStyle(circles[5] + circles[2], 0x3366AA);
            this.graphics.drawCircle(ggg[0], ggg[1], dis / 2);

            return ggg;
        }




        public function
        prv_distance(
            points:Array,
            offset:uint
        ):Number {

            var x_diff_sq:Number =
                (points[offset + 3] - points[offset]) *
                (points[offset + 3] - points[offset]);

            var y_diff_sq:Number =
                (points[offset + 4] - points[offset + 1]) *
                (points[offset + 4] - points[offset + 1]);

            return Math.sqrt(x_diff_sq + y_diff_sq);
        }




        public function
        prv_mid_point(
            points:Array,
            offset:uint
        ):Array {

            var x_mid_pt:Number =
                (points[offset] + points[offset + 3]) / 2;

            var y_mid_pt:Number =
                (points[offset + 1] + points[offset + 4]) / 2;

            return [x_mid_pt, y_mid_pt, 0];
        }




        public function
        prv_circle_draw(
            circles:Array,
            oi:uint
        ):void {

            if (! circles) return;

            //this.graphics.beginFill(0xFF0000, .025);

            this.graphics.moveTo(circles[oi + 3], circles[oi + 4]);

            if (circles[oi + 2] < 33)
            {
                this.graphics.lineTo(circles[oi + 0], circles[oi + 1]);
                /*
                this.graphics.drawCircle(
                        circles[oi + 0],
                        circles[oi + 1],
                        circles[oi + 2]);

                        */



            }
           // this.graphics.endFill();

            //this.graphics.beginFill(0x0000FF, .025);


            this.graphics.moveTo(circles[oi + 0], circles[oi + 1]);

            if (circles[oi + 5] < 33)
            {
                this.graphics.lineTo(circles[oi + 3], circles[oi + 4]);

                /*
                this.graphics.drawCircle(
                        circles[oi + 3],
                        circles[oi + 4],
                        circles[oi + 5]);
                      */


            }
            //this.graphics.endFill();
        }




         public function
        prv_circle_isect(
            circles:Array,
            circles2:Array,
            ci1:uint,
            ci2:uint
        ):Array {

            if (circles[ci1 + 0] == circles2[ci2 + 0] &&
                circles2[ci2 + 1] == circles2[ci2 + 1])
            {
                return null;
            }

            if (circles[ci1 + 2] < 1 || circles2[ci2 + 2] < 1)
            {
                return null;
            }

            var distance:Number =
                prv_distance(
                    circles,
                    0);


            var dx:Number = circles2[ci2 + 0] - circles[ci1 + 0];
            var dy:Number = circles2[ci2 + 1] - circles[ci1 + 1];
            var d:Number = Math.sqrt((dy * dy) + (dx * dx));

            if (d > circles[ci1 + 2] + circles2[ci2 + 2])
            {
                return null;
            }

            if (d < Math.abs(circles[ci1 + 2] - circles2[ci2 + 2]))
            {
                return null;
            }


            var a:Number =
                ((circles[ci1 + 2] * circles[ci1 + 2]) -
                 (circles2[ci2 + 2] * circles2[ci2 + 2]) +
                 (d * d)) / (2 * d);

            var x2:Number = circles[ci1 + 0] + (dx * a / d);
            var y2:Number = circles[ci1 + 1] + (dy * a / d);
            var h:Number = Math.sqrt((circles[ci1 + 2] * circles[ci1 + 2]) - 
(a * a));

            // center circle
           // this.graphics.drawEllipse(x2 - (h * 2), y2 - h, d * 2, h * 2);
          // this.graphics.drawCircle(x2, y2, h);



            var rx:Number = -dy * (h / d);
            var ry:Number = dx * (h / d);


            var p1x:Number = x2 + -h * (circles2[ci2 + 1] - circles[ci1 + 
1]) / d;
            var p1y:Number = y2 + h * (circles2[ci2 + 0] - circles[ci1 + 0]) 
/ d;
            var p2x:Number = p1x - ((p1x - x2) * 2);
            var p2y:Number = p1y - ((p1y - y2) * 2);

            /*
            this.graphics.drawCircle(p1x, p1x, 10);
            this.graphics.drawCircle(p2x, p2y, 10);
            this.graphics.moveTo(p1x, p1y);
            this.graphics.lineTo(p2x, p2y);
            */

            var hr:Number = h / mcr1;

            return [p1x, p1y, hr, p2x, p2y, hr];
        }






        public function
        prv_circle_isectx1111(
            circles:Array,
            ci1:uint,
            ci2:uint
        ):Array {

            if (circles[ci1 + 2] < .5 || circles[ci2 + 2] < .5)
            {
                return null;
            }

            var distance:Number =
                prv_distance(
                    circles,
                    0);


            var dx:Number = circles[ci2 + 0] - circles[ci1 + 0];
            var dy:Number = circles[ci2 + 1] - circles[ci1 + 1];
            var d:Number = Math.sqrt((dy * dy) + (dx * dx));

            if (d > circles[ci1 + 2] + circles[ci2 + 2])
            {
                return null;
            }

            if (d < Math.abs(circles[ci1 + 2] - circles[ci2 + 2]))
            {
                return null;
            }


            var a:Number =
                ((circles[ci1 + 2] * circles[ci1 + 2]) -
                 (circles[ci2 + 2] * circles[ci2 + 2]) +
                 (d * d)) / (2 * d);

            var x2:Number = circles[ci1 + 0] + (dx * a / d);
            var y2:Number = circles[ci1 + 1] + (dy * a / d);
            var h:Number = Math.sqrt((circles[ci1 + 2] * circles[ci1 + 2]) - 
(a * a));

            // center circle
           // this.graphics.drawEllipse(x2 - (h * 2), y2 - h, d * 2, h * 2);
          // this.graphics.drawCircle(x2, y2, h);



            var rx:Number = -dy * (h / d);
            var ry:Number = dx * (h / d);


            var p1x:Number = x2 + -h * (circles[ci2 + 1] - circles[ci1 + 1]) 
/ d;
            var p1y:Number = y2 + h * (circles[ci2 + 0] - circles[ci1 + 0]) 
/ d;
            var p2x:Number = p1x - ((p1x - x2) * 2);
            var p2y:Number = p1y - ((p1y - y2) * 2);

            /*
            this.graphics.drawCircle(p1x, p1x, 10);
            this.graphics.drawCircle(p2x, p2y, 10);
            this.graphics.moveTo(p1x, p1y);
            this.graphics.lineTo(p2x, p2y);
            */



            return [p1x, p1y, h, p2x, p2y, h];
        }




        public function
        prv_circle_isectxx(
            circles:Array,
            ci1:uint,
            ci2:uint
        ):Array {

            if (circles[ci1 + 2] < .5 || circles[ci2 + 3] < .5)
            {
                return null;
            }

            var distance:Number =
                prv_distance(
                    circles,
                    0);


            var dx:Number = circles[ci2 + 0] - circles[ci1 + 0];
            var dy:Number = circles[ci2 + 2] - circles[ci1 + 1];
            var d:Number = Math.sqrt((dy * dy) + (dx * dx));

            if (d > circles[ci1 + 2] + circles[ci2 + 3])
            {
                return null;
            }

            if (d < Math.abs(circles[ci1 + 2] - circles[ci1 + 3]))
            {
                return null;
            }


            var a:Number =
                ((circles[ci1 + 2] * circles[ci1 + 2]) -
                 (circles[ci2 + 3] * circles[ci2 + 3]) +
                 (d * d)) / (2 * d);

            var x2:Number = circles[ci1 + 0] + (dx * a / d);
            var y2:Number = circles[ci1 + 1] + (dy * a / d);
            var h:Number = Math.sqrt((circles[ci1 + 2] * circles[ci1 + 2]) - 
(a * a));

            // center circle
           // this.graphics.drawEllipse(x2 - (h * 2), y2 - h, d * 2, h * 2);
          // this.graphics.drawCircle(x2, y2, h);



            var rx:Number = -dy * (h / d);
            var ry:Number = dx * (h / d);


            var p1x:Number = x2 + -h * (circles[ci2 + 2] - circles[ci1 + 1]) 
/ d;
            var p1y:Number = y2 + h * (circles[ci2 + 0] - circles[ci1 + 0]) 
/ d;
            var p2x:Number = p1x - ((p1x - x2) * 2);
            var p2y:Number = p1y - ((p1y - y2) * 2);

            /*
            this.graphics.drawCircle(p1x, p1x, 10);
            this.graphics.drawCircle(p2x, p2y, 10);
            this.graphics.moveTo(p1x, p1y);
            this.graphics.lineTo(p2x, p2y);
            */



            return [p1x, p1y, h, p2x, p2y, h];
        }







        public function
        prv_circle_isectx(
            circles:Array
        ):Array {

            if (circles[2] < .5 || circles[5] < .5)
            {
                return null;
            }

            var distance:Number =
                prv_distance(
                    circles,
                    0);


            var dx:Number = circles[3] - circles[0];
            var dy:Number = circles[4] - circles[1];
            var d:Number = Math.sqrt((dy * dy) + (dx * dx));

            if (d > circles[2] + circles[5])
            {
                return null;
            }

            if (d < Math.abs(circles[2] - circles[5]))
            {
                return null;
            }


            var a:Number =
                ((circles[2] * circles[2]) -
                 (circles[5] * circles[5]) +
                 (d * d)) / (2 * d);

            var x2:Number = circles[0] + (dx * a / d);
            var y2:Number = circles[1] + (dy * a / d);
            var h:Number = Math.sqrt((circles[2] * circles[2]) - (a * a));

            // center circle
           // this.graphics.drawEllipse(x2 - (h * 2), y2 - h, d * 2, h * 2);
          // this.graphics.drawCircle(x2, y2, h);



            var rx:Number = -dy * (h / d);
            var ry:Number = dx * (h / d);


            var p1x:Number = x2 + -h * (circles[4] - circles[1]) / d;
            var p1y:Number = y2 + h * (circles[3] - circles[0]) / d;
            var p2x:Number = p1x - ((p1x - x2) * 2);
            var p2y:Number = p1y - ((p1y - y2) * 2);

            /*
            this.graphics.drawCircle(p1x, p1x, 10);
            this.graphics.drawCircle(p2x, p2y, 10);
            this.graphics.moveTo(p1x, p1y);
            this.graphics.lineTo(p2x, p2y);
            */



            return [p1x, p1y, h / 1.14, p2x, p2y, h / 1.14];
        }
    }
}
__________________________________________________________________________



Perhaps it might be of service to your query. 

[toc] | [prev] | [next] | [standalone]


#3042

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-02-18 16:36 -0800
Message-ID<kfuhds$skb$1@speranza.aioe.org>
In reply to#3041
"Chris M. Thomasson"  wrote in message 
news:kfuetu$msp$1@speranza.aioe.org...

> "Brian"  wrote in message 
> news:b3b13a29-514f-43b1-9ca7-03ae8189d635@gu9g2000vbb.googlegroups.com...

> > Hi, I was reading an article about fractals, and the article says that
> > fractals by themselves have no shape or form, but that computers can
> > be used to convert fractals into images.  What exactly is a fractal?

[...]

> FWIW, and since this is comp.programming, here is a retarded first attempt 
> at creating such circle intersection fractal, presented in AS3 of course!

__________________________________________________________________________
[...]
__________________________________________________________________________


IMVVHO, this actually ends up creating a fairly pretty picture. Kind of 
looks like two galaxy's on the verge of merging, and folding their black 
holes together into a single singularity.

> Perhaps it might be of service to your query. 

[toc] | [prev] | [next] | [standalone]


#3070

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-02-20 18:25 -0800
Message-ID<kg40il$nn4$1@speranza.aioe.org>
In reply to#3042
"Chris M. Thomasson"  wrote in message 
news:kfuhds$skb$1@speranza.aioe.org...

> FWIW, and since this is comp.programming, here is a retarded first attempt 
> at creating such circle intersection fractal, presented in AS3 of course!
[...]

Sorry about all the comments and renamed functions in the code. FWIW, here 
is the same but, cleaned up a bit:
__________________________________________________________________
package
{
    import flash.display.Sprite;
    import flash.events.Event;

    /**
     * ...
     * @author Chris M. Thomasson
     */
    public class Main extends Sprite
    {

        private var mcr1:Number = 3;
        private var mcr2:Number = 3;



        public function
        prv_draw(i:uint, cmp1:Array, cmp2:Array):void {

            if (i > 33 || ! cmp1 || ! cmp2) return;

            var c:Number = cmp1[2] + cmp2[2];

            c = (c * 314) * (c * 628) + 0xFF0000;

            this.graphics.lineStyle(.277 / (i / 22),
                0xFFFFFF, .1);

            prv_circle_draw(cmp1, 0);



            var isect1:Array = prv_circle_isect(cmp1, cmp2, 0, 3);


            if (isect1)
            {
                prv_draw(i + 1, isect1, cmp1);
                prv_draw(i + 1, isect1, cmp2);


                prv_draw(i + 1, cmp1, isect1);
                prv_draw(i + 1, cmp2, isect1);
            }

        }



        public function
        Main():void {
            addEventListener(Event.ENTER_FRAME, prv_cdraw_render);

        }



        public function
        prv_cdraw_render(e5:Event = null):void {
            this.graphics.clear();

            var circles:Array = [
                222, 266, 222,
                488, 300, 222];


            this.graphics.lineStyle(1, 0xFFFFFF, .1);

            this.graphics.drawCircle(circles[0], circles[1], circles[2]);
            this.graphics.drawCircle(circles[3], circles[4], circles[5]);

            prv_draw(0, circles, circles);


            mcr1 -= .007;
            mcr2 += .17;
        }



        public function
        prv_distance(
            points:Array,
            offset:uint
        ):Number {

            var x_diff_sq:Number =
                (points[offset + 3] - points[offset]) *
                (points[offset + 3] - points[offset]);

            var y_diff_sq:Number =
                (points[offset + 4] - points[offset + 1]) *
                (points[offset + 4] - points[offset + 1]);

            return Math.sqrt(x_diff_sq + y_diff_sq);
        }



        public function
        prv_circle_draw(
            circles:Array,
            oi:uint
        ):void {

            if (! circles) return;

            this.graphics.moveTo(circles[oi + 3], circles[oi + 4]);

            if (circles[oi + 2] < 33)
            {
                this.graphics.lineTo(circles[oi + 0], circles[oi + 1]);


            }


            this.graphics.moveTo(circles[oi + 0], circles[oi + 1]);

            if (circles[oi + 5] < 33)
            {
                this.graphics.lineTo(circles[oi + 3], circles[oi + 4]);



            }
        }



         public function
        prv_circle_isect(
            circles:Array,
            circles2:Array,
            ci1:uint,
            ci2:uint
        ):Array {

            if (circles[ci1 + 0] == circles2[ci2 + 0] &&
                circles2[ci2 + 1] == circles2[ci2 + 1])
            {
                return null;
            }

            if (circles[ci1 + 2] < 1 || circles2[ci2 + 2] < 1)
            {
                return null;
            }

            var distance:Number =
                prv_distance(
                    circles,
                    0);


            var dx:Number = circles2[ci2 + 0] - circles[ci1 + 0];
            var dy:Number = circles2[ci2 + 1] - circles[ci1 + 1];
            var d:Number = Math.sqrt((dy * dy) + (dx * dx));

            if (d > circles[ci1 + 2] + circles2[ci2 + 2])
            {
                return null;
            }

            if (d < Math.abs(circles[ci1 + 2] - circles2[ci2 + 2]))
            {
                return null;
            }


            var a:Number =
                ((circles[ci1 + 2] * circles[ci1 + 2]) -
                 (circles2[ci2 + 2] * circles2[ci2 + 2]) +
                 (d * d)) / (2 * d);

            var x2:Number = circles[ci1 + 0] + (dx * a / d);
            var y2:Number = circles[ci1 + 1] + (dy * a / d);
            var h:Number = Math.sqrt((circles[ci1 + 2] * circles[ci1 + 2]) - 
(a * a));


            var rx:Number = -dy * (h / d);
            var ry:Number = dx * (h / d);


            var p1x:Number = x2 + -h * (circles2[ci2 + 1] - circles[ci1 + 
1]) / d;
            var p1y:Number = y2 + h * (circles2[ci2 + 0] - circles[ci1 + 0]) 
/ d;
            var p2x:Number = p1x - ((p1x - x2) * 2);
            var p2y:Number = p1y - ((p1y - y2) * 2);


            var hr:Number = h / mcr1;

            return [p1x, p1y, hr, p2x, p2y, hr];
        }
    }
}
__________________________________________________________________


[toc] | [prev] | [next] | [standalone]


#3109

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-02-26 02:21 -0800
Message-ID<kgi2c2$vdn$1@speranza.aioe.org>
In reply to#3041
> "Chris M. Thomasson"  wrote in message 
> news:kfuetu$msp$1@speranza.aioe.org...

> "Brian"  wrote in message 
> news:b3b13a29-514f-43b1-9ca7-03ae8189d635@gu9g2000vbb.googlegroups.com...

> > Hi, I was reading an article about fractals, and the article says that
> > fractals by themselves have no shape or form, but that computers can
> > be used to convert fractals into images.  What exactly is a fractal?

> Self-similarity across various levels of scaling.

> [...]

FWIW, here are some links to images created by the algorithm:


http://webpages.charter.net/appcore/fractal/cisect_imgs/p1.jpg

http://webpages.charter.net/appcore/fractal/cisect_imgs/p2.jpg

http://webpages.charter.net/appcore/fractal/cisect_imgs/p3.jpg


Humm... The border looks fairly "rough" to me...


;^) 

[toc] | [prev] | [next] | [standalone]


#3125

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-03-03 17:59 -0800
Message-ID<kh0v6r$blv$1@speranza.aioe.org>
In reply to#3109
"Chris M. Thomasson"  wrote in message 
news:kgi2c2$vdn$1@speranza.aioe.org...

[...]

> FWIW, here are some links to images created by the algorithm:

> http://webpages.charter.net/appcore/fractal/cisect_imgs/p1.jpg

> http://webpages.charter.net/appcore/fractal/cisect_imgs/p2.jpg

> http://webpages.charter.net/appcore/fractal/cisect_imgs/p3.jpg


Here is another, IMHO, nice image:

http://webpages.charter.net/appcore/fractal/cisect_imgs/p4.jpg

:^) 

[toc] | [prev] | [next] | [standalone]


#3328

Fromluser droog <mijoryx@yahoo.com>
Date2013-05-17 18:55 -0700
Message-ID<03b5602c-f698-436f-b5e3-54e35e59f4ad@googlegroups.com>
In reply to#3125
On Sunday, March 3, 2013 7:59:33 PM UTC-6, Chris M. Thomasson wrote:
> "Chris M. Thomasson"  wrote in message 
> 
> news:kgi2c2$vdn$1@speranza.aioe.org...
> 
> 
> 
> [...]
> 
> 
> 
> > FWIW, here are some links to images created by the algorithm:
> 
> 
> 
> > http://webpages.charter.net/appcore/fractal/cisect_imgs/p1.jpg
> 
> 
> 
> > http://webpages.charter.net/appcore/fractal/cisect_imgs/p2.jpg
> 
> 
> 
> > http://webpages.charter.net/appcore/fractal/cisect_imgs/p3.jpg
> 
> 
> 
> 
> 
> Here is another, IMHO, nice image:
> 
> 
> 
> http://webpages.charter.net/appcore/fractal/cisect_imgs/p4.jpg
> 
> 
> 
> :^)

That one's really cool. A wreath, or a small baobab-infested planetoid.

[toc] | [prev] | [next] | [standalone]


#3330

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-05-17 22:27 -0700
Message-ID<kn73ga$33u$1@speranza.aioe.org>
In reply to#3328
> "luser droog"  wrote in message 
> news:03b5602c-f698-436f-b5e3-54e35e59f4ad@googlegroups.com...
>
> On Sunday, March 3, 2013 7:59:33 PM UTC-6, Chris M. Thomasson wrote:
> > "Chris M. Thomasson"  wrote in message
> >
> > news:kgi2c2$vdn$1@speranza.aioe.org...
> > [...]
> > > FWIW, here are some links to images created by the algorithm:
> > [...]
> > Here is another, IMHO, nice image:
> >
> > http://webpages.charter.net/appcore/fractal/cisect_imgs/p4.jpg
> > [...]


> That one's really cool. A wreath, or a small baobab-infested planetoid.

Thanks. IMVHO, it kind of looks like entropy contained within the event
horizon of a black hole. Well, infinite until you hit plank...

Can one link a plank pixel to both sides of a black hole?





-- some crazy ramblings ---


I think there is a way to get around plank limit and have a
fractal universe. Imagine that our big bang was the result of
a massive super nova in a parent dimension of time. A star in our
parent universe happened to collapse into a singularity and
condensed matter into our big bang. In other words, the creation
of a singularity might be able to contain a child universe in and
of itself, but at a radically different interpretation of time wrt
the parent. 5 Minutes relative to the parent might be thousands
of years relative to the child.

If a parent dimension of time can create a child via ultra massive
black hole... That means our own universe/dimension of time has
many children... Each quasar might have child universes. Humm...


Sorry about that. There has to be a way around plank limits. 

[toc] | [prev] | [next] | [standalone]


#3126

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-03-04 13:17 -0800
Message-ID<kh331v$3id$1@speranza.aioe.org>
In reply to#3109

"Chris M. Thomasson"  wrote in message 
news:kgi2c2$vdn$1@speranza.aioe.org...
[...]

> FWIW, here are some links to images created by the algorithm:

Some more:

http://webpages.charter.net/appcore/fractal/cisect_imgs/p5.jpg

http://webpages.charter.net/appcore/fractal/cisect_imgs/p6.jpg

http://webpages.charter.net/appcore/fractal/cisect_imgs/p7.jpg


Perhaps I should make a webpage for this crap...

;^) 

[toc] | [prev] | [next] | [standalone]


#3156

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-03-10 18:10 -0700
Message-ID<khjb0e$ck9$1@speranza.aioe.org>
In reply to#3109
"Chris M. Thomasson"  wrote in message 
news:kgi2c2$vdn$1@speranza.aioe.org...

[...]

>> FWIW, here are some links to images created by the algorithm:

Here are some more fairly "awesome" circle intersection fractal images
of mine:

http://webpages.charter.net/appcore/fractal/cisect_imgs/p8.jpg

http://webpages.charter.net/appcore/fractal/cisect_imgs/p9.jpg


FWIW, `p9.jpg' is a zoom of `p8.jpg' upper left hand corner. The zoom
was not further iterated, and you still get further detail...

Also, closely examine all of the black regions enclosed in color. Then
examine the border of the fractal.

The black basically defines the set.
Any other color is out of the set.

The sets are all oozing from self-similarity...


What do you think? 

[toc] | [prev] | [next] | [standalone]


#3157

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-03-10 18:21 -0700
Message-ID<khjbib$dod$1@speranza.aioe.org>
In reply to#3109
"Chris M. Thomasson"  wrote in message 
news:kgi2c2$vdn$1@speranza.aioe.org...

[...]

>> FWIW, here are some links to images created by the algorithm:

> Here are some more fairly "awesome" circle intersection fractal images
> of mine:

> http://webpages.charter.net/appcore/fractal/cisect_imgs/p8.jpg

> http://webpages.charter.net/appcore/fractal/cisect_imgs/p9.jpg

Oops. I forgot to post this one, which is basically an "x-ray" for image 
`p8.jpg':

http://webpages.charter.net/appcore/fractal/cisect_imgs/p10.jpg

I say x-ray because I decrease the alpha channel, and you can see further
inner structure and self-similarity...   :^) 

[toc] | [prev] | [next] | [standalone]


#3045

FromJames Dow Allen <gmail@jamesdowallen.nospam>
Date2013-02-19 17:45 +0000
Message-ID<XnsA16D7B156E61jamesdowallen@178.63.61.175>
In reply to#2869
Perhaps the most interesting method of image compression I've ever read 
about is Fractal Compression.  The idea is "VQ" or codebook compression -- 
each small image block is represented by an index into a codebook, along 
with parameters to scale luminance, contrast, etc.

What's the difference between Fractal Compression and ordinary VQ 
compression?  NO CODEBOOK IS TRANSMITTED!  The image itself (scaled down) 
is ITS OWN CODEBOOK!  (If it seems like the decompression task is 
impossible, light a candle and whisper "recursion"!)

Fractal compression was used for Microsoft's Encarta, but I don't know what 
the present status is.  I coded my own simple version for fun -- it's 
trivial to do.  The method works best on certain types of image; ferns and 
mountains being the most well-known examples.

Jams Dow Allen

[toc] | [prev] | [next] | [standalone]


#3046

From"Chris M. Thomasson" <no@spam.invalid>
Date2013-02-19 13:11 -0800
Message-ID<kg0ppu$v37$1@speranza.aioe.org>
In reply to#3045
> "James Dow Allen"  wrote in message 
> news:XnsA16D7B156E61jamesdowallen@178.63.61.175...

> Perhaps the most interesting method of image compression I've ever read
> about is Fractal Compression.

[...]

I "think" the guy who invented it appears within the following video:

http://www.youtube.com/watch?v=Lk6QU94xAb8

If I am wrong, I am sorry about the non-sense!

;^/ 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web