Logo by mclarekin - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 26, 2024, 07:50:03 AM


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: A new JIT formula  (Read 3928 times)
0 Members and 1 Guest are viewing this topic.
gannjondal
Forums Freshman
**
Posts: 17


« on: March 05, 2016, 04:09:47 PM »

After a long time just reading this forum I dare to create my first topic here in the fractalforums.

So please forgive me if there should be something wrong, for instance with the style, the language (I'm not an Engish native), or the place of this topic.
Please feel free to correct me if needed...

//NOTE: 
   Just when I have finished this entry I'm reading the ongoing discussion about conformal mapping.
   I will leave this entry as an own topic unless the admins do think that it should be moved.
   Guess this entry has not exactly the same focus, and as it's maybe too long for a simple answer .

Well then.
A few days after Andreas / thargor6 has published the new version of MB3D v190 I have started to write some formulas with some goold old memories to Fractint/UF.
Most of that formulas have been very simple, and partially I just tried to re-build some of the basic formulas which come with MB3D (like RealPower), just for understanding.

I would nevertheless like to present the most elaborated group of formulas.

First in short what steps all of them are doing:

  1. Normalize the 3D coordinates by dividing them by R=sqrt(x^2+y^2+z^2)
      (both, the current value, and the c value separately)
  2. Interpret that resulting sphere as a Riemann sphere, and
       transform the parameters to the complex plane (cartesian coordinates)
  3. Do some operation in complex plane (this differs from formula to formula).
  4. Map the result back to the Riemann sphere.
  5. Multiply again with R

As you can see this is more a transformation than an independent formula.
Therefore I have moved them to the Ads tabs.
I just left one under 3D since together with IFS formula like MengerIFS the Ads version does work strange
(well, I still have to learn quite much).

First that was thought as a finger exercise, but I was surprised about the results - and that it kept relatively fast.

There are -as of now- 3 formulas:

  • 1.  _JIT_gnj_RiemSimple - At step 3 it does nothing else than to add, and to multiply:
            t(n+1) = Complex_MultAll * (Complex_MultZ * t(n) + Complex_AddC * c + Complex_AddFix)
        It does only work with cartesian coordinates to keep fast by avoiding trigonometric functions.
  • 2.  _JIT_gnj_RiemPowRadial - Similar to 1. It just works with (r,phi) instead of (x,y)
        This one is of course slower than 1, even with optimizations like the use of SinCos()
  • 3.  _JIT_gnj_RiemPow2 - At step 3 it calculates a classical z^2+c (ok, I have no phantasy ;-))
        This is more thought as a kind of transformation as of now;
        also I have some issues with using integer values in the current version.
        Therefore it can use only up to 3 calculations.
        The operation z^k+c can be done in formula 2 as well, but 3 is faster as it again avoids trigonometric functions etc

I am attaching the m3f files (RiemannSphereFormulas.zip). They contain also some details about the parameters etc.

As an example I want to share the active part of _JIT_gnj_RiemSimple_01.m3f as text.
This of course does also explain the most of the parameters:

Code:
[OPTIONS]
.DEOption = -1
.DEScale = 1
.SIPow = 2
.Version = 9
.Double AddCAtEnd = 0
.Double Complex_AddC_x = 0
.Double Complex_AddC_y = 0
.Double Complex_AddFix_x = 0
.Double Complex_AddFix_y = 0
.Double Complex_MultAll_x = 1
.Double Complex_MultAll_y = 0
.Double Complex_MultZ_x = 1
.Double Complex_MultZ_y = 0
.Double Shift_QuotBackward = 1
.Double Shift_QuotCForward = 1
.Double Shift_QuotXYZForward = 1
.Double SquaredRBackward = 0
[SOURCE]
procedure MyFormula(var x, y, z, w: Double; PIteration3D: TPIteration3D);

var
   cx, cy, cz: double;
   rc, sq_rc: double;
   cx_norm, cy_norm, cz_norm: double;


   r, sq_r: double;
   x_norm, y_norm, z_norm: double;
   quot_xyz, quot_c, quot_xyz_back: double;

   cmp_r, cmp_phi: double;
   cmp_x, cmp_y: double;
   cmp_cx, cmp_cy: double;
   cmp_xtmp, cmp_ytmp: double;
  

   r_pow, theta_pow, phi_pow: double;
   sph, sth, cph, cth: double;

begin
   cx := PIteration3D^.J1;
   cy := PIteration3D^.J2;
   cz := PIteration3D^.J3;
  

// calculating helper variables
   sq_rc := cx*cx + cy*cy + cz*cz;
   rc := sqrt(sq_rc);

   sq_r := x*x + y*y + z*z;
   r := sqrt(sq_r);

// normalization

   x_norm := x/r;
   y_norm := y/r;
   z_norm := z/r;

   cx_norm := cx/r;
   cy_norm := cy/r;
   cz_norm := cz/r;

// transform to complex

   quot_xyz := 1/(Shift_QuotXYZForward-z_norm);
   cmp_x := x_norm*quot_xyz;
   cmp_y := y_norm*quot_xyz;
  
   quot_c := 1/(Shift_QuotCForward-cz_norm);
   cmp_cx := cx_norm*quot_c;
   cmp_cy := cy_norm*quot_c;

// complex calculation

   cmp_xtmp := cmp_cx*Complex_AddC_x - cmp_cy*Complex_AddC_y + cmp_x*Complex_MultZ_x - cmp_y*Complex_MultZ_y + Complex_AddFix_x;
   cmp_ytmp := cmp_cx*Complex_AddC_y + cmp_cy*Complex_AddC_x + cmp_y*Complex_MultZ_x + cmp_x*Complex_MultZ_y + Complex_AddFix_y;
  
   cmp_x := cmp_xtmp;
   cmp_y := cmp_ytmp;

   cmp_xtmp := cmp_x*Complex_MultAll_x - cmp_y*Complex_MultAll_y;
   cmp_ytmp := cmp_x*Complex_MultAll_y + cmp_y*Complex_MultAll_x;  

   cmp_x := cmp_xtmp;
   cmp_y := cmp_ytmp;


// transform back to sphere / triplex;

   quot_xyz_back := 1/(Shift_QuotBackward + cmp_x*cmp_x + cmp_y*cmp_y);

   x_norm := 2*cmp_x*quot_xyz_back;
   y_norm := 2*cmp_y*quot_xyz_back;
   z_norm := (cmp_x*cmp_x + cmp_y*cmp_y - 1)*quot_xyz_back;

// de-nomalization

   If SquaredRBackward = 1 then
     begin
       x := x_norm * sq_r + AddCAtEnd*cx;
       y := y_norm * sq_r + AddCAtEnd*cy;
       z := z_norm * sq_r + AddCAtEnd*cz;
     end
   else
     begin    
       x := x_norm * r + AddCAtEnd*cx;
       y := y_norm * r + AddCAtEnd*cy;
       z := z_norm * r + AddCAtEnd*cz;
     end;

end;
[END]

You can best test them if you take one of above formulas as the first formula (or pre-transformation), and as the second a simple IntegerPower.
Since the normal bulb is not far from a sphere the above formulas can do good-natured changes.
For instance , increasing Complex_MultAll_x to higher positive numbers moves all details to the north pole,
while going down near to 0 moves them to the south pole.
Adding values to Complex_MultAll_y does introduce of course some rotation etc.
That may sound a bit boring; however using some of the other values, or taking the formulas at the second tab can create surprising stuff like spheres with tentacles, and hairs.

Three examples (more params are attached):

1. This one is not spectacular, but I guess a good start point of exploration:



Code:
Mandelbulb3Dv18{
g.....Y/...g2...w....IA....vui0d4uk/.HgX.MdmL/7EusoDTj7l0wP/sbPGHFEqzkEnwG2.dPxj
................................y6zdTJcLtz1........A./..................y.2...wD
...Uz6............/0/....2.A0...u.....E4.....AXHke6xFioD/.......aeed0dkpXm1.5JJJ
./EnAnYD16../2U3THb4j9BszuUXkV6EMdxDJy75v9nhYz9...........U5.....y1...sD...../..
.z1...kDcY0EkqIMWxPyqkW9nm/1wArH79p8RscDbItZw5sg3ufGHmYWzlLKzicZPh0cxdpja0vVltBs
2uXpsFN9UqbKzKgEdUsTwZpDU.....Ya/.............sD.6....sD..G.....................
.............oAnAt1...sD....zw1.........................................B....k1.
.....CnAnz1.......kz/wzzz1UO..6.P....g6...kF....O..qCA1.kdEE....4/...cX8..E8OJzH
Z25U.qFG9yDh7jyz4wkBzPQir06.pc..zXCc..kYEkti4xyD66gJ7KDgdz1............2mwzFrA0.
.6HNL1YPWz9.EXXla4Dxz0..........2.n9zbZGy...GPBMzJcgzOWisNgDvWwD.E7DL9o9ryP.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1...................................2CcN/UvNPcveeWCNq0.yRiibHJJUk1f..XR
SvBmx3CcN/UvNPcvQsLsUa3.ibhVi1bTV1OK.sSq4uCly3CcN/UvNPcvMwLsUa3.ibhVinqTV1OK.sSq
4uCkz3CcN/UvNPcv..EsUa3feeWCNqGQIJ36wk8EwyLsUa3f................................
E....6E.F2U.....I....Q....kL8Z2JTRaPexZIdJKPExqRmw3Ao.kLk2XM....................
..............................zD........kz9........wz.........zD........kz1.....
................................................................................
.....................6..........0....YYPoJqNZ756ExqRZ75.........................
8............................U.E........kz9.....................................
................................................................................
................................}
{Titel: jit036}


2.  This one is a bit more fancy, although it struggles with the DE:



Code:
Mandelbulb3Dv18{
g.....Y/...g2...w....I....U6fDLSWY21.1P51R3rea1EYIeJrIhIKy9mx4erzg6szALDqspDYCyj
................................eGzR6hZupz1........Y./..................y.2...wD
...Uz6...........U.0/....2UO1...V/....E4.....kwtwWEEezoD/.....sDwXFt.dkpXo1.5JJJ
.FEnAnQD16../2U0sAkwhwbtzaUbENwRAJyDxPuD27Yzgz9...........U5.....y1...sD...../..
.z1...kDyLMaAeE8ZxHC1Qo8Dmi7zSbtUTpiigmDFM9V/yER4uHDPx7IsL2Mzg/0GkKtdhpDSvY9Agrl
lwPgQ/TYnBoKzuzgan6Bj.qDU.....og0.............sD.6....sD..G.....................
.............oAnAt1...sD....zw1...................................E7Rh.EB....k1.
.....CnAnz1.......kz/wzzz1EJ.s6.P.....7...kF....p..a7k3.UWkD....2/...cn6....SJ5I
8U5U.SmG/yDh7jyz2wkBz5whp06.rc..frBh...wQOr9PExD6UNAT2kYsz1............25xzEkQ0.
.IsffaWeYz9.1se7Umvxz0........../EU0.wzzz1...........E0........./.........E.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1...................................2CcN/UvNPcveeWCNq0.yRiibHJJUk1f..XR
SvBmx3CcN/UvNPcvQsLsUa3.ibhVi1bTV1OK.sSq4uCly3CcN/UvNPcvMwLsUa3.ibhVinqTV1OK.sSq
4uCkz3CcN/UvNPcv..EsUa3feeWCNqGQIJ36wk8EwyLsUa3f................................
E....6E.F2U.....I....Q....UG7FpLbtaOT7JOZp4IjRbAT/HB..kLkA1.....................
.............................U.E........kzPnAnAnAnAxz.........zDOaNaNaNa7z1.....
...wz...........................................................................
.....................6.....3....5....oINiRKNmZYFH/..............................
.....MU/4....................U.E........kz1........wz.........yD................
................................................................................
................................}
{Titel: jit041}


3.  And here the sphere does stretch its tentacles:


Simplified params:
Code:
Mandelbulb3Dv18{
g....Es...Uy/...w....I....kE.ruT324yzu6wUTQmiV/E9VrOeblGKyfAk7OuJJssz.0T5pVovSvj
................................fk2n92MW2.2........A.Nf/................z.2...wD
...Uz6....E2.....U.0/....2.E3...p.....E4.....InUeS2r3toD/.....sD..sC0dNaNs1....w
zIEnAnQD16../2EaXFzRR/ZtziFAKOnp2oyDnk4OmD7CDy1...........U5.....y1...sD...../..
.z1...kDfNGaVML/Fxf4YGPK9sjxyMsUC6wLoKjj0yhVuJmyrv1OkAY3My25zQtJBTlci1pjqlpKj8qa
ovfvj9E0tuCIzuc7Nq2vglljU.....2z..........kAnAnD.6....sD..G.....................
.............oAnAt1...sD....zw1...................................kjri1E8....k1.
.....CnAnz1.......kz.wzzz1UF.c1.P....Q3....D....H/...M0...UE....5/...cHB....SJ5I
At/U.imGxxDh7jyz1o.BzbCrM16Epc..zXCc..UAZRBEi7yj6A72QifFDz9............28.kFrA0.
.s41pmERLz9.5T51vojwz0..........2E.6zfOAQ...hIKtQRmezuFmD/nWGUxj.oAu.H.xyyP.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1...................................geW9/EpR8dvTL/hXA0.2HuWbXu8aRH7.Axc
auRI.NfBI/.rYadv2aIPgA4.pnfei1oIuq0b.sPVutiiQt77q.EhxBbvDM4MVB7.BHNVivoPHp07.kwY
3uynspr9K/EnJWcv..EsUa3feeWCNqGQIJ36wk8EwyLsUa3f................................
E....6E.F2E.....I....Q....kL8Z2JTRaPexZIdJKPExqRmw3Ao.kLk6HM....................
.............................U.E........kz9........wz.........zD........kz1.....
...wz...........................................................................
.....................2.....3..../.....pQZJ5NjV3F0/UA............................
.....MU/4.....................zD................................................
................................................................................
................................}
{Titel: m3d1-0166-002c-XXL-v190}

* RiemannSphereParams.zip (9.53 KB - downloaded 226 times.)
* RiemannSphereFormulas.zip (7.96 KB - downloaded 230 times.)
« Last Edit: March 05, 2016, 04:57:48 PM by gannjondal » Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Where does THE formula come from ? Mandelbrot & Julia Set bib 5 5314 Last post January 26, 2009, 07:12:10 PM
by cKleinhuis
Formula? Theory « 1 2 » lkmitch 20 9924 Last post March 23, 2010, 06:01:56 AM
by jehovajah
Has anyone tried this formula? Theory « 1 2 3 » TedWalther 32 15293 Last post December 06, 2009, 02:58:08 PM
by jehovajah
New 3D IFS formula for UF5 IFS - Iterated Function Systems « 1 2 » fractalrebel 18 22041 Last post November 13, 2011, 01:39:30 AM
by xenodreambuie
@jesse - save formula as new formula ?! feature request cKleinhuis 0 5081 Last post October 10, 2012, 05:43:14 PM
by cKleinhuis

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.661 seconds with 25 queries. (Pretty URLs adds 0.008s, 2q)