Title: Swap Functions Post by: HazardHarry on June 18, 2017, 03:22:35 AM Just like my last topic, I doubt I'm the first to come up with this. Hopefully I'll make up for that by including some example code and pictures. Each example picture includes the equivalent Mandelbrot Set in the upper-left hand corner, a Julia Set spread in the upper-right, and two Julia Set examples underneath.
I'm using Z^2 + C as the basis for all of these examples, but you'll get interesting results no matter what equation you use them on. Also, I only show two types of conditional swap functions below (swapIfRealIsLessThanImaginary and swapIfRealIsLessThanImaginary), but there are tons of different types of conditions you can create. ----- Swap: Swap the real and imaginary parts of a given complex number. If you have 3 + 5i, it becomes 5 + 3i. Code: static Complex swap(Complex in) {swap(Z^2 + C): (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20S%20UI_zpsc1pkr3wn.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20S%20UI_zpsc1pkr3wn.png.html) swap(Z^2) + C: (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20S%20UO_zpswnvzbnb9.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20S%20UO_zpswnvzbnb9.png.html) ----- Swap If Real Is Less Than Imaginary: Swap the real and imaginary parts of a given complex number if the real part is less than the imaginary part. Code: static Complex swapIfRealIsLessThanImaginary(Complex in) {swapIfRealIsLessThanImaginary(Z^2 + C): (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20SRLI%20UI_zps6nph8ocy.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20SRLI%20UI_zps6nph8ocy.png.html) swapIfRealIsLessThanImaginary(Z^2) + C: (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20SRLI%20UO_zpscs8fznak.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20SRLI%20UO_zpscs8fznak.png.html) ----- Swap If Real Is Greater Than Imaginary: Swap the real and imaginary parts of a given complex number if the real part is greater than the imaginary part. Code: static Complex swapIfRealIsGreaterThanImaginary(Complex in) {swapIfRealIsGreaterThanImaginary(Z^2 + C): (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20SRGI%20UI_zpsfrnbanag.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20SRGI%20UI_zpsfrnbanag.png.html) swapIfRealIsGreaterThanImaginary(Z^2) + C: (http://i163.photobucket.com/albums/t287/Syrrah323/Spread%20SRGI%20UO_zpsuqqjkara.png) (http://s163.photobucket.com/user/Syrrah323/media/Spread%20SRGI%20UO_zpsuqqjkara.png.html) Title: Re: Swap Functions Post by: SamTiba on June 18, 2017, 10:12:12 PM I like the implementation of swapIfRealIsLess(and so on)!
Really cool idea to play around with the original formula in a simple way. Title: Re: Swap Functions Post by: Dinkydau on June 21, 2017, 01:28:22 PM Some of those julias a pretty cool.
Title: Re: Swap Functions Post by: Gerson on June 21, 2017, 04:24:41 PM Liked it. Which software did you use to do that?
Title: Re: Swap Functions Post by: HazardHarry on June 22, 2017, 05:57:54 PM @SamTiba & @Dinkydau - Thanks!
@Gerson - It's software that I wrote. I plan on releasing it for free sometime, but before I do I need to do a major user-friendliness overhaul on it. *edit* I was looking at the Wikipedia article for the Burning Ship Fractal earlier and noticed that the Conditional Swap functions seem to share a lot in common with it. "swapIfRealIsLessThanImaginary(Z^2) + C" in particular looks like a slightly more "sunken" Burning Ship. When I have some time later I'll compile some images that show off the similarities between the Julia sets of the equations. Title: Re: Swap Functions Post by: 0xbeefc0ffee on June 25, 2017, 04:01:42 AM Such a novel idea is bound to have lots of potential
Title: Re: Swap Functions Post by: Gerson on June 26, 2017, 07:10:54 PM Good news. Let me know when you release it. |