Author Topic: Chaos Game  (Read 4101 times)

0 Members and 1 Guest are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Chaos Game
« Reply #15 on: December 20, 2013, 08:06:10 pm »
Xeda: I have a challenge for you: Do a Mandelbrot set.

That's a chaos game, right?

* pimathbrainiac hopes he didn't ask something stupid...
I am Bach.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Chaos Game
« Reply #16 on: December 20, 2013, 11:44:42 pm »
The Mandelbrot set is not a chaos game, actually. A chaos game is just starting with a handful of vertices, and jumping halfway to a randomly selected vertex. Ideally, you would do this for infinitely many points, but we can't, so we just do it for a gazillion.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Chaos Game
« Reply #17 on: December 24, 2013, 01:18:33 am »
I am working on updating it to allow custom inputs for vertices. It Currently allows input as a real list in the form of {y1,x1,y2,x2,...} or a complex list where each component is {y1+ix1,y2+ix2,...}.

However, for quick testing it will probably be a lot easier to simply pass a number and have the program generate a regular polygon with the given number of vertices. So should I add this? The program is currently small-ish at 210 bytes plus the RNG to test.

Also, I was thinking of having it be able to take input in a string as "nn,filename" where nn is the number of vertices and filename is the variable that has a data stream to directly test.

Thoughts?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Chaos Game
« Reply #18 on: December 24, 2013, 11:15:35 pm »
What LFSR's are you using? I'd be curious to see if there is an LFSR that does work, as LFSR's are pretty fast.
I figured out that I was using the second one incorrectly. The lower bits are not that great to use, but the upper byte or using both actually turns out really well. I started the seed with 1.

Also, I made an update. It will run a little slower now, but it is much more useful offering many more vertex tests without the need to constantly recompile. You can supply your own vertices or have the program generate N vertices for a regular polygon (it uses a sine routine).