Logo by reallybigname - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. March 28, 2024, 01:39:43 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Inflection mappings  (Read 3165 times)
0 Members and 1 Guest are viewing this topic.
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« on: January 27, 2017, 10:41:57 AM »

Inflection mappings



http://www.fractalforums.com/index.php?action=gallery;sa=view;id=19987

Morphing a basic Mandelbrot-shape 30 times, which would require a zoom depth of E1406173.
But this image is actually out-zoomed, calculated with plain double datatypes.
Points are transformed according to this:

// Get the points in the mandelbrot for the screen coordinates
r = r_start+x*(r_stop-r_start)/nX;
i = i_start+y*(i_stop-i_start)/nY;

// Transform the coordinates for each inflection point
int inf;
for(inf=g_nInflections-1;inf>=0;inf--){
   if(r>g_pInflections[inf].r){
      r = g_pInflections[inf].r - (r-g_pInflections[inf].r);
      i = g_pInflections[inf].i - (i-g_pInflections[inf].i);
   }
   double ratio = (double)(i-g_pInflections[inf].i)/(double)(r-g_pInflections[inf].r);
   double degree = -atan(ratio);
   double dist = sqrt((double)((r-g_pInflections[inf].r)*(r-g_pInflections[inf].r)+(i-g_pInflections[inf].i)*(i-g_pInflections[inf].i)))/diagonal;
   double dr = (double)g_pInflections[inf].r + (double)(r-g_pInflections[inf].r)*cos(degree)*dist
      + (double)(i-g_pInflections[inf].i)*sin(degree)*dist;
   double di = (double)g_pInflections[inf].i + (double)(i-g_pInflections[inf].i)*cos(degree)*dist
      - (double)(r-g_pInflections[inf].r)*sin(degree)*dist;
   r=dr;
   i=di;
}

// Contiunue with the ordinary mandelbrot calculation sequence                  
« Last Edit: January 27, 2017, 01:50:31 PM by Kalles Fraktaler » Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
superheal
Alien
***
Posts: 24


« Reply #1 on: January 27, 2017, 10:54:49 AM »

Can you share the contents of the infections array, or how you generate it?  grin
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #2 on: January 27, 2017, 12:59:58 PM »

I select the points in the inflection array by clicking in the image, the points which I want the pattern to be wrapped around smiley
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
Dinkydau
Fractal Senior
******
Posts: 1616



WWW
« Reply #3 on: January 27, 2017, 07:50:22 PM »

Nice. Is this a new feature in Kalles Fraktaler?
Logged

gds-entropy
Alien
***
Posts: 29


« Reply #4 on: January 27, 2017, 10:24:59 PM »

Looks quite nice.

This is very similar to the "Origami Butterfly" technique used by Jonatan McCabe, but with a different source of data for reflection/folding. There is some Processing code out there which mimics this.

Ian
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #5 on: January 31, 2017, 10:50:01 PM »

Nice. Is this a new feature in Kalles Fraktaler?
No sorry, I am just playing with a program using plain double datatype
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #6 on: February 02, 2017, 12:14:07 AM »

I think your code can be simplified and optimized using properties of right-angled triangles:

Code:
dist = sqrt(dx * dx + dy * dy)
ratio = dy / dx
angle = atan(ratio)

cos(angle) = adjacent / hypotenuse = dx / sqrt(dx * dx + dy * dy)
sin(angle) = opposite / hypotenuse = dy / sqrt(dx * dx + dy * dy)

cos(angle) * dist = dx
sin(angle) * dist = dy

There may be some sign errors, and I ignored your 'diagonal' variable not knowing what it does, but nothing that can't be solved cheaply afaict.

EDIT then it can be simplified further using properties of complex numbers:

Code:
double _Complex inflectionmapping(int n, double _Complex *cs, double _Complex c)
{
  for (int i = 0; i < n; ++i)
  {
    double _Complex d = c - cs[i];
    c = cs[i] + d * d;
  }
  return c;
}

I haven't tested this yet, but I'm fairly confident that it's this simple!
« Last Edit: February 02, 2017, 12:35:31 AM by claude, Reason: typo » Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #7 on: February 02, 2017, 09:34:07 AM »

Awesome claude, that's magic!
Yes it works smiley

And your code get rid of sqrt, cos, sin, tan and also the arbitrary constant "diagonal" which was simply the size of the diagonal of the window.

If you want to test it, please note that you probably need to reverse the order of applying the inflection points.

So this is the new simplified code:
Code:
// Map the screen pixels to points in the fractal
r = r_start+x*(r_stop-r_start)/nX;
i = i_start+y*(i_stop-i_start)/nY;
int inf;
std::complex<double> c(r,i);
for(inf=g_nInflections-1;inf>=0;inf--){
std::complex<double> cs(g_pInflections[inf].r,g_pInflections[inf].i);
std::complex<double> d = c-cs;
c=cs+d*d;
}
r=c.real();
i=c.imag();
// Proceed with the fractal sequence
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
hobold
Fractal Bachius
*
Posts: 573


« Reply #8 on: February 05, 2017, 02:18:57 PM »

These inflections are kinda nice even without an underlying fractal formula:

Here I used 1/z of a checkerboarded complex plane as the underlying pattern. Then three different inflections. Each inflection doubles the number of "flowers" (really the pole of 1/z), so there are eight in total.
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #9 on: February 06, 2017, 12:19:01 AM »

These inflections are kinda nice even without an underlying fractal formula:
...image...
Here I used 1/z of a checkerboarded complex plane as the underlying pattern. Then three different inflections. Each inflection doubles the number of "flowers" (really the pole of 1/z), so there are eight in total.
Cool!
I tried myself with photo images, however close around the inflection point the pattern is magnified a lot, and if the image is not very large (large AA) the pixels get quite visible


* atlantis.jpg (233.86 KB, 922x541 - viewed 313 times.)
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #10 on: February 11, 2017, 12:50:29 AM »

There are two ways to do inflection mapping, one with Mandelbrot iterations (inflect C, start iterating at Z = 0), and another with Julia iterations (inflect Z, iterate with C set to the first inflection point (last to be applied)).

Here's a Mandelbrot version in Fragmentarium:

http://www.fractalforums.com/images-showcase-%28rate-my-fractal%29/fruity-%28inflection-mapping%29/

Here's a Julia version in Fragmentarium:

Code:
#include "Progressive2D.frag"

vec2 cMul(vec2 a, vec2 b)
{
  return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}

vec2 cSqr(vec2 a)
{
  return cMul(a, a);
}

vec4 cMul(vec4 a, vec4 b)
{
  return vec4(cMul(a.xy, b.xy), cMul(a.xy, b.zw) + cMul(a.zw, b.xy));
}

vec4 cSqr(vec4 a)
{
  return cMul(a, a);
}

#define N 6
const vec2 cs[N] = vec2[N]
  ( vec2(-0.75, 0.1)
  , vec2(-0.7780062, 0.9591821)
  , vec2(-0.7186571, 1.0251421)
  , vec2(-0.5475953, 0.6401844)
  , vec2(-0.5129835, 0.6237739)
  , vec2(-0.4531227, 0.8943247)
  );

vec3 color(vec2 c0)
{
  float px = length(vec4(dFdx(c0), dFdy(c0)));
  vec4 c = vec4(c0, px, 0.0);
  for (int i = N-1; i >= 0; --i)
  {
    vec4 f = vec4(cs[i], 0.0, 0.0);
    vec4 d = c - f;
    c = cSqr(d) + f;
  }
  int n = 0;
  vec4 z = c;
  for (n = 0; n < 1000; ++n)
  {
    if (dot(z.xy, z.xy) >= 1.0e10)
      break;
    z = cSqr(z) + vec4(cs[0], 0.0, 0.0);
  }
  if (dot(z.xy, z.xy) < 1.0e10)
    return vec3(1.0, 0.0, 0.0);
  float r = length(z.xy);
  float dr = length(z.zw);
  float de = 2.0 * r * log(r) / dr;
  float g = tanh(clamp(de, 0.0, 4.0));
  if (isnan(de) || isinf(de) || isnan(g) || isinf(g))
    g = 1.0;
  return vec3(g);
}

Image of the Julia version:
Logged
hapf
Fractal Lover
**
Posts: 219


« Reply #11 on: May 16, 2017, 11:46:06 AM »

Where exactly is the region of the first posting? And was it retested with the simplified algorithm and looked the same as before?
Logged
Adam Majewski
Fractal Lover
**
Posts: 221


WWW
« Reply #12 on: May 16, 2017, 05:31:33 PM »

These inflections are kinda nice even without an underlying fractal formula:
<Quoted Image Removed>
Here I used 1/z of a checkerboarded complex plane as the underlying pattern. Then three different inflections. Each inflection doubles the number of "flowers" (really the pole of 1/z), so there are eight in total.

Great image
Can you post the code ?
can you upload it to commons ?




Logged
hapf
Fractal Lover
**
Posts: 219


« Reply #13 on: July 27, 2017, 12:10:01 PM »

The scaling can not be done away with in the fast algorithm. In the general case scaling is needed.
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Colourings and Mappings Programming David Makin 1 3321 Last post March 07, 2011, 11:14:36 AM
by Softology
Fractal Flame using complex functions as conformal mappings (new) Theories & Research tit_toinou 0 569 Last post December 11, 2011, 02:52:59 PM
by tit_toinou
Inflection Reflection Mandelbulb3D Gallery 1Bryan1 0 1214 Last post June 20, 2016, 08:47:13 AM
by 1Bryan1
Inflection mappings Celtic Images Showcase (Rate My Fractal) Kalles Fraktaler 7 1927 Last post February 01, 2017, 09:34:16 PM
by Kalles Fraktaler
Inflection mappings Perpendicular Mandelbrot Images Showcase (Rate My Fractal) Kalles Fraktaler 3 1374 Last post February 01, 2017, 10:31:52 AM
by TheRedshiftRider

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.253 seconds with 24 queries. (Pretty URLs adds 0.035s, 2q)