Recent

Author Topic: Fractal-Like Patterns using Primes (and co-primes)  (Read 603 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Fractal-Like Patterns using Primes (and co-primes)
« on: September 14, 2024, 12:59:06 pm »
Found a Javascript that produces interesting intricate fractal like patterns based on primes (and Fibonacci).

The patterns I feel are not real fractal patterns, but close to  fractal patterns (as fractal patterns repeat themselves identically over the recursion levels). These patterns don't exactly repeat themselves identically.

I think it was originally made by Sergey Gerasimov, Ukraine, Kiev.
The fractal was found by considering the interference of waves on the surface of the river.


Alter the size of the two TSpinedits to get different fractal curves.

Also included is a javascript version that uses the position of the mouse cursor.







« Last Edit: September 17, 2024, 09:32:36 am by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal using Primes (and co-primes)
« Reply #1 on: September 14, 2024, 01:13:29 pm »
And here is a screenshot of the JavaScript version (included in zip attachment) run in Firefox:

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal using Primes (and co-primes)
« Reply #2 on: September 14, 2024, 02:48:26 pm »
Emulated the JavaScript version using Lazarus.

Kinda really like the end result. Groovy !

Looking at the patterns. They are quite intricate and differ by small amounts to make new fractal curves.
The original inventor was certainly a cluey person in the area of mathematics.

Now you can mouse the mouse to get different patterns and click to freeze.

Then save to png (with a 10 pixel border)..
« Last Edit: September 14, 2024, 03:00:38 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal using Primes (and co-primes)
« Reply #3 on: September 14, 2024, 03:26:56 pm »
Some interesting "Almost Metal" type patterns in Black and White.

The last 2 are actually different, but they look quite similar.
« Last Edit: September 14, 2024, 03:29:25 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal using Primes (and co-primes)
« Reply #4 on: September 15, 2024, 02:43:41 am »
Added parameter info. to png filename.
« Last Edit: September 15, 2024, 02:45:56 am by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal using Primes (and co-primes)
« Reply #5 on: September 15, 2024, 03:56:46 am »
I went about manually colouring similar sized shapes and got some interesting effects.

The shapes seem to be repeating in an odd sort of way for the 1st and 3rd attached png.
The 2nd attached png shows an alternating colour pattern (I only filled one point on 1 line)

Is there a way of doing that programmatically?
« Last Edit: September 15, 2024, 04:00:57 am by Boleeman »

VisualLab

  • Hero Member
  • *****
  • Posts: 521
Re: Fractal using Primes (and co-primes)
« Reply #6 on: September 15, 2024, 09:54:33 pm »
Boleeman, these presented patterns (especially those from message no. 5) are great for wall hangings, tapestries as well as various rugs and carpets. Maybe you could expand these programs to a graphic pattern editor version for lovers of textile handicrafts such as embroidery, weaving, crocheting, etc. :)

But seriously, I suspect that there are very few such programs (especially free ones). In any case, I have not come across any (but I admit, I have no talent in the field of textile handicraft).

Boleeman

  • Hero Member
  • *****
  • Posts: 692
Re: Fractal-Like Patterns using Primes (and co-primes)
« Reply #7 on: September 17, 2024, 10:03:47 am »
Sorry VisualLab for the late reply, as I have been a bit sick (with a viral infection). I still remember how you helped me out with regular polygons many moons ago (when I was learning Lazarus). Thanks for your nice words. I just love using mathematics to make programs that create different sorts of interesting patterns.

This program I thought created identically repeating fractal patterns. but after investigating a bit I see it does not create identical repeating patterns. Colouring identical bits with particular colours showed variations in the pattern.

I had thought of maybe combining all my curve programs to make one program that does all, but I am sort of heading towards learning how to make and save as SVG, using Bgrabmp (instead of just png). I can see how they can be used for textile handicrafts such as embroidery, weaving, crocheting. Saving as SVG would mean that we could enlarge or shrink the patterns and not lose quality. Even thought of making plugins for Lazpaint in a similar way to Paint.net and GIMP.

Been running out of hard disk space (because I keep creating samples of lots of patterns), so  will need to perhaps get another laptop with a bigger hard disk. Also would be nice to perhaps see different OS versions (bought a 2nd hand Mac but need to set it up with Lazarus). Too many ideas and not enough time in the day.
 
Thanks to the Lazarus forum members for their nice help and advice.
« Last Edit: September 17, 2024, 10:08:44 am by Boleeman »

 

TinyPortal © 2005-2018