File:Menger 4D Mod1 25072019 8K.jpg

Original file(8,000 × 4,500 pixels, file size: 28.25 MB, MIME type: image/jpeg)

Captions

Captions

Created with mandelbulber2.

Summary edit

Description
Deutsch: Formel:

void Menger4dMod1Iteration(CVector4 &z, const sFractal *fractal, sExtendedAux &aux) {

 double paraAddP0 = 0.0;
 if (fractal->Cpara.enabledParabFalse)
 { // parabolic = paraOffset + iter *slope + (iter *iter *scale)
   paraAddP0 = fractal->Cpara.parabOffset0 + (aux.i * fractal->Cpara.parabSlope)
               + (aux.i * aux.i * 0.001 * fractal->Cpara.parabScale);
   z.w += paraAddP0;
 }
 if (aux.i >= fractal->transformCommon.startIterationsC
     && aux.i < fractal->transformCommon.stopIterationsC)
 {
   z += fractal->transformCommon.additionConstant0000; // offset
 }
 z = fabs(z);
 if (z.x - z.y < 0.0) swap(z.y, z.x);
 if (z.x - z.z < 0.0) swap(z.z, z.x);
 if (z.y - z.z < 0.0) swap(z.z, z.y);
 if (z.x - z.w < 0.0) swap(z.w, z.x);
 if (z.y - z.w < 0.0) swap(z.w, z.y);
 if (z.z - z.w < 0.0) swap(z.w, z.z);
 // 6 plane rotation
 if (fractal->transformCommon.functionEnabledRFalse
     && aux.i >= fractal->transformCommon.startIterationsR
     && aux.i < fractal->transformCommon.stopIterationsR)
 {
   CVector4 tp;
   if (fractal->transformCommon.rotation44a.x != 0)
   {
     tp = z;
     double alpha = fractal->transformCommon.rotation44a.x * M_PI_180;
     z.x = tp.x * cos(alpha) + tp.y * sin(alpha);
     z.y = tp.x * -sin(alpha) + tp.y * cos(alpha);
   }
   if (fractal->transformCommon.rotation44a.y != 0)
   {
     tp = z;
     double beta = fractal->transformCommon.rotation44a.y * M_PI_180;
     z.y = tp.y * cos(beta) + tp.z * sin(beta);
     z.z = tp.y * -sin(beta) + tp.z * cos(beta);
   }
   if (fractal->transformCommon.rotation44a.z != 0)
   {
     tp = z;
     double gamma = fractal->transformCommon.rotation44a.z * M_PI_180;
     z.x = tp.x * cos(gamma) + tp.z * sin(gamma);
     z.z = tp.x * -sin(gamma) + tp.z * cos(gamma);
   }
   if (fractal->transformCommon.rotation44b.x != 0)
   {
     tp = z;
     double delta = fractal->transformCommon.rotation44b.x * M_PI_180;
     z.x = tp.x * cos(delta) + tp.w * sin(delta);
     z.w = tp.x * -sin(delta) + tp.w * cos(delta);
   }
   if (fractal->transformCommon.rotation44b.y != 0)
   {
     tp = z;
     double epsilon = fractal->transformCommon.rotation44b.y * M_PI_180;
     z.y = tp.y * cos(epsilon) + tp.w * sin(epsilon);
     z.w = tp.y * -sin(epsilon) + tp.w * cos(epsilon);
   }
   if (fractal->transformCommon.rotation44b.z != 0)
   {
     tp = z;
     double zeta = fractal->transformCommon.rotation44b.z * M_PI_180;
     z.z = tp.z * cos(zeta) + tp.w * sin(zeta);
     z.w = tp.z * -sin(zeta) + tp.w * cos(zeta);
   }
 }
 double scaleM = fractal->transformCommon.scale3;
 CVector4 offsetM = fractal->transformCommon.additionConstant111d5;
 z.x = scaleM * z.x - offsetM.x;
 z.y = scaleM * z.y - offsetM.y;
 z.w = scaleM * z.w - offsetM.w;
 if (fractal->transformCommon.functionEnabledz
     && aux.i >= fractal->transformCommon.startIterationsM
     && aux.i < fractal->transformCommon.stopIterationsM)
 {
   z.z -= 0.5 * offsetM.z / scaleM;
   z.z = -fabs(-z.z);
   z.z += 0.5 * offsetM.z / scaleM;
 }
 else
 {
   z.w = scaleM * z.w - offsetM.w;
 }
 z.z *= scaleM;
 aux.DE *= scaleM;
 if (fractal->transformCommon.functionEnabledSFalse
     && aux.i >= fractal->transformCommon.startIterationsS
     && aux.i < fractal->transformCommon.stopIterationsS)
 {
   double r2 = 0.;
   if (fractal->transformCommon.functionEnabledBxFalse)
   {
     r2 = z.x * z.x + z.y * z.y;
   }
   if (fractal->transformCommon.functionEnabledByFalse)
   {
     r2 = z.x * z.x + z.y * z.y + z.z * z.z;
   }
   if (fractal->transformCommon.functionEnabledBz)
   //{  r2 = z.Dot(z) ;}
   {
     r2 = z.x * z.x + z.y * z.y + z.z * z.z + z.w * z.w;
   }
   // if (r2 < 1e-21 && r2 > -1e-21) r2 = (r2 > 0) ? 1e-21 : -1e-21;
   if (r2 < fractal->transformCommon.minR2p25)
   {
     z *= fractal->transformCommon.maxMinR2factor;
     aux.DE *= fractal->transformCommon.maxMinR2factor;
     aux.color += fractal->mandelbox.color.factorSp1;
   }
   else if (r2 < fractal->transformCommon.maxR2d1)
   {
     double tglad_factor2 = fractal->transformCommon.maxR2d1 / r2;
     z *= tglad_factor2;
     aux.DE *= tglad_factor2;
     aux.color += fractal->mandelbox.color.factorSp2;
   }
 }
 if (fractal->transformCommon.functionEnabledFalse)
 {
   CVector4 zA4 = (aux.i == fractal->transformCommon.intA) ? z : CVector4();
   CVector4 zB4 = (aux.i == fractal->transformCommon.intB) ? z : CVector4();
   z = (z * fractal->transformCommon.scale) + (zA4 * fractal->transformCommon.offset)
       + (zB4 * fractal->transformCommon.offset0);
   aux.DE *= fractal->transformCommon.scale1;
 }
aux.DE *= fractal->analyticDE.scale1;
}
Date
Source Own work
Author PantheraLeo1359531


Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:11, 25 July 2019Thumbnail for version as of 21:11, 25 July 20198,000 × 4,500 (28.25 MB)PantheraLeo1359531 (talk | contribs)User created page with UploadWizard

The following page uses this file:

Metadata