trafassel
Fractal Bachius

Posts: 531
|
 |
« on: September 05, 2010, 09:28:15 PM » |
|
Met and mostly forget.
|
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #1 on: September 05, 2010, 09:31:00 PM » |
|
int gr=20;
/// <summary> /// Initialisierung /// </summary> public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden. }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double aar, aai, ai_alt, aj_alt, aaj, aak, cj, ck, ari, arj, ark, aik, aij, ajk, ak_alt; double c, d; long tw; int n;
aar = ar * ar; aai = ai * ai; aaj = aj * aj; tw = 0L; d = aar + aai + aaj; for (n = 1; n < zkl; n++) { ai = ai * ar * aj + bi; aj = aaj - (aai + aar) / 2.0 + bj; ar = aar - (aai + aaj) / 2.0 + br; aar = ar * ar; aai = ai * ai; aaj = aj * aj; d = aar + aai + aaj; if ((d) > gr) { tw = n; break; } } return (tw);
}
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #2 on: September 05, 2010, 09:47:26 PM » |
|
int gr=20;
/// <summary> /// Initialisierung /// </summary> public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden. }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double aar, aai, ai_alt, aj_alt, aaj, aak, cj, ck, ari, arj, ark, aik, aij, ajk, ak_alt; double c, d; long tw; int n;
aar = ar * ar; aai = ai * ai; aaj = aj * aj; tw = 0L; d = aar + aai + aaj; for (n = 1; n < zkl; n++) { ai = ai *( ar + aj )+ bi; aj = aaj - (aai + aar) / 2.0 + bj; ar = aar - (aai + aaj) / 2.0 + br; aar = ar * ar; aai = ai * ai; aaj = aj * aj; d = aar + aai + aaj; if ((d) > gr) { tw = n; break; } } return (tw);
}
|
|
|
|
Logged
|
|
|
|
|
kram1032
|
 |
« Reply #3 on: September 06, 2010, 11:46:57 PM » |
|
nice smooth shapes, nice German comments 
|
|
|
|
|
Logged
|
|
|
|
|
KRAFTWERK
|
 |
« Reply #4 on: September 07, 2010, 12:58:09 PM » |
|
I like this one trafassel! 
|
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #5 on: September 07, 2010, 06:33:26 PM » |
|
int gr=20;
/// <summary> /// Initialisierung /// </summary> public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden. }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double aar, aai, ai_alt, aj_alt, aaj, aak, cj, ck, ari, arj, ark, aik, aij, ajk, ak_alt; double c, d; long tw; int n;
aar = ar * ar; aai = ai * ai; aaj = aj * aj; tw = 0L; d = aar + aai + aaj; for (n = 1; n < zkl; n++) { ai = ai * ar * aj + bi; aj = aaj - (aai + aar) / 2.0 + bj; ar = aar - (aai + aaj) / 2.0 + br; aar = ar * ar; aai = ai * ai; aaj = aj * aj; d = aar + aai + aaj; if ((d) > gr) { tw = n; break; } } return (tw);
}
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #6 on: September 07, 2010, 09:53:59 PM » |
|
int gr=20;
/// <summary> /// Initialisierung /// </summary> public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden. }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double aar, aai, ai_alt, aj_alt, aaj, aak, cj, ck, ari, arj, ark, aik, aij, ajk, ak_alt; double c, d; long tw; int n;
aar = ar * ar; aai = ai * ai; aaj = aj * aj; tw = 0L; d = aar + aai + aaj; for (n = 1; n < zkl; n++) { ai = ai *( ar + 0.5*aj )+ bi; aj = aaj - (aai + aar) / 2.0 + bj; ar = aar - (aai + aaj) / 2.0 + br; aar = ar * ar; aai = ai * ai; aaj = aj * aj; d = aar + aai + aaj; if ((d) > gr) { tw = n; break; } } return (tw);
}
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #7 on: October 30, 2010, 10:37:15 PM » |
|
// Mandel bottle
int gr=20; public override void Init() { base.Init(); additionalPointInfo=new AdditionalPointInfo(); }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj;
xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation();
additionalPointInfo.red=0; additionalPointInfo.green=0; additionalPointInfo.blue=0; for (n = 1; n < zkl; n++) { double phi = Math.Atan2(y, x); double phi2 = Math.Atan2(y, z);
// Rotation double mult=1; vecRot.y = -Math.Sin(mult*phi2); vecRot.x =0; vecRot.z =-Math.Cos(mult*phi2);
vecRot.angle =phi; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; r = Math.Sqrt(xx + yy + zz); if(r!=0) { additionalPointInfo.red+=x*x/r; additionalPointInfo.green+=y*y/r; additionalPointInfo.blue+=z*z/r; } x *= r; y *= r; z *= r; y += bj; x += br; z += bi;
if (r > gr) { tw = n; break; } }
// Switch inner and outer view if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #8 on: October 31, 2010, 06:32:57 PM » |
|
// This and the last one are interpreted as Mandelbrot Type (Formula.Static.Formula=-1) // (Julia type in all other "Gestalten": Formula.Static.Formula=-2) // Difference Julia <-> Mandel: // Julia: br,bi,bj are fixed. ar, ai and aj corresponds to (x,y,z) in the set // Mandel: ar, ai and aj are fixed. br,bi,bj corresponds to (x,y,z) in the set
int gr=20;
public override void Init() { base.Init(); additionalPointInfo=new AdditionalPointInfo(); }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
additionalPointInfo.red=0; additionalPointInfo.green=0; additionalPointInfo.blue=0;
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj;
xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation(); for (n = 1; n < zkl; n++) { double phi = Math.Atan2(y, x); double phi2 = Math.Atan2(y, z);
// Erste Rotation
vecRot.y = Math.Sin(2*phi2); vecRot.x =0; vecRot.z =Math.Cos(2*phi2); vecRot.angle =-2.0*phi; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; r = Math.Sqrt(xx + yy + zz);
if(r!=0) { additionalPointInfo.red+=x*x/r; additionalPointInfo.green+=y*y/r; additionalPointInfo.blue+=z*z/r;
} x *= r; y *= r; z *= r; y += bj; x += br; z += bi;
if (r > gr) { tw = n; break; } }
if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #9 on: November 01, 2010, 01:19:02 AM » |
|
// Julia Variant
// Julia =(0.2,0.4,0)
int gr=20;
/// <summary> /// Initialisierung /// </summary> public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden. }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj; double r_n = 0; //y=bj; //z=bi; xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation(); for (n = 1; n < zkl; n++) { double r_xy = Math.Sqrt(xx + yy); double theta = Math.Atan2(Math.Sqrt(xx + yy), z); double phi = Math.Atan2(y, x);
// Für die erste Rotation werden Quaternionen benutzt // Erste Rotation
vecRot.x = 0; vecRot.y =0; vecRot.z =1; vecRot.angle = phi; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; r = Math.Sqrt(xx + yy + zz);
// Zweite vecRot.x = 1; vecRot.y =1; vecRot.z =0; vecRot.angle = theta; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos2=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos2= vecRot.getTransform(pos2); x = newPos2.X; y = newPos2.Y; z = newPos2.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; r = Math.Sqrt(xx + yy + zz); x *= r; y *= r; z *= r; y += bj; x += br; z += bi;
if (r > gr) { tw = n; break; } }
// Hier könnte die zweite Rotation hin
// Hinzugefügt, um bei der Ansicht von innen nur den Kern zu zeirgrn. if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #10 on: November 02, 2010, 08:58:47 PM » |
|
int gr=20;
public override void Init() { base.Init(); }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj;
xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation(); for (n = 1; n < zkl; n++) {
// 1. Rotation
double phi = Math.Atan2(y, x); double phi2 = Math.Atan2(y, z);
double mult1=-4.0; double mult2=-2.0; double mult3=2.0; double mult4=2.0; double mult5=2.0; double mult6=2.0;
vecRot.y = -Math.Sin(mult2*phi2); vecRot.x =0; vecRot.z =-Math.Cos(mult2*phi2); vecRot.angle =mult1*phi; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz; x *= r; y *= r; z *= r;
// 2. Rotation
phi = Math.Atan2(y, x); phi2 = Math.Atan2(x, z);
vecRot.x = -Math.Sin(mult3*phi2); vecRot.y =0; vecRot.z =-Math.Cos(mult3*phi2); vecRot.angle =mult4*phi; vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz;
x *= r; y *= r; z *= r;
// 3. Rotation
phi = Math.Atan2(z, x); phi2 = Math.Atan2(x, y);
vecRot.x = -Math.Sin(mult5*phi2); vecRot.z =0; vecRot.y =-Math.Cos(mult5*phi2); vecRot.angle =mult6*phi; vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz;
x *= r; y *= r; z *= r;
y += bj; x += br; z += bi;
if (r > gr) { tw = n; break; } }
if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #11 on: November 02, 2010, 09:03:27 PM » |
|
int gr=20;
public override void Init() { base.Init(); }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj;
xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation(); for (n = 1; n < zkl; n++) {
// 1. Rotation
double phi = Math.Atan2(y, x); double phi2 = Math.Atan2(y, z);
double mult1=-4.0; double mult2=-2.0; double mult3=2.0; double mult4=2.0; double mult5=-2.0; double mult6=2.0;
vecRot.y = -Math.Sin(mult2*phi2); vecRot.x =0; vecRot.z =-Math.Cos(mult2*phi2); vecRot.angle =mult1*phi; vecRot.Normalize(); Fractrace.Geometry.Vec3 pos=new Fractrace.Geometry.Vec3(x,y,z); Fractrace.Geometry.Vec3 newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz; r*=r; x *= r; y *= r; z *= r;
// 2. Rotation
phi = Math.Atan2(y, x); phi2 = Math.Atan2(x, z);
vecRot.x = -Math.Sin(mult3*phi2); vecRot.y =0; vecRot.z =-Math.Cos(mult3*phi2); vecRot.angle =mult4*phi; vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz; r*=r; x *= r; y *= r; z *= r;
// 3. Rotation
phi = Math.Atan2(z, x); phi2 = Math.Atan2(x, y);
vecRot.x = -Math.Sin(mult5*phi2); vecRot.z =0; vecRot.y =-Math.Cos(mult5*phi2); vecRot.angle =mult6*phi; vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;// aak = ak * ak; // r = Math.Sqrt(xx + yy + zz); r=xx+yy+zz;
x *= r; y *= r; z *= r;
y += bj; x += br; z += bi;
if (r > gr) { tw = n; break; } }
if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #12 on: November 03, 2010, 01:18:54 AM » |
|
int gr=20; public override void Init() { base.Init(); additionalPointInfo=new AdditionalPointInfo();
// Julia seeds for Data319pic10021:
// The following must be called if this formula is inserted via text copy, because // the formula needs the following additional variables, // After the first time, the following must be "comment in", because // otherwise all user setting in this variables will be overridden.
/* AddValue("Formula.VecRot.Mult1",1); AddValue("Formula.VecRot.Angle1Rot",2); AddValue("Formula.VecRot.Angle1Type",4); AddValue("Formula.VecRot.Angle1Mult",1);
AddValue("Formula.VecRot.Mult2",0); AddValue("Formula.VecRot.Angle2Mult",0); AddValue("Formula.VecRot.Angle2Type",0); AddValue("Formula.VecRot.Angle2Rot",0);
AddValue("Formula.VecRot.Mult3",0); AddValue("Formula.VecRot.Angle3Mult",0); AddValue("Formula.VecRot.Angle3Type",0); AddValue("Formula.VecRot.Angle3Rot",0);
AddValue("Formula.VecRot.Power",2); */
}
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double xx, yy, zz; long tw; int n; double x = ar, y = ai, z = aj;
xx = x * x; yy = y * y; zz = z * z; tw = 0; double r = Math.Sqrt(xx + yy + zz); Fractrace.Geometry.VecRotation vecRot = new Fractrace.Geometry.VecRotation();
double mult1=GetDouble("Formula.VecRot.Mult1"); double mult2=GetDouble("Formula.VecRot.Angle1Mult"); double mult3=GetDouble("Formula.VecRot.Mult2"); double mult4=GetDouble("Formula.VecRot.Angle2Mult"); double mult5=GetDouble("Formula.VecRot.Mult3"); double mult6=GetDouble("Formula.VecRot.Angle3Mult"); double power=GetDouble("Formula.VecRot.Power"); int angleType1=(int) GetDouble("Formula.VecRot.Angle1Type"); int angleType2=(int) GetDouble("Formula.VecRot.Angle2Type"); int angleType3=(int) GetDouble("Formula.VecRot.Angle3Type"); int angleRotationType1=(int) GetDouble("Formula.VecRot.Angle1Rot"); int angleRotationType2=(int) GetDouble("Formula.VecRot.Angle2Rot"); int angleRotationType3=(int) GetDouble("Formula.VecRot.Angle3Rot");
double phi = 0; double phi2 = 0; double phi3 = 0;
Fractrace.Geometry.Vec3 pos=null; Fractrace.Geometry.Vec3 newPos= null;
additionalPointInfo.red=0; additionalPointInfo.green=0; additionalPointInfo.blue=0; for (n = 1; n < zkl; n++) {
// ********************************** // 1. Rotation // *************************************
phi = Math.Atan2(y, x); phi2 = Math.Atan2(y, z); phi3 = Math.Atan2(z, x);
if(mult2!=0) {
// Rotation Angle Corresponding Angle Type // 0 : (1,0,0) // 1: (0,1,0); // 2: (0,0,1); // 3: Plane including point (x,y,z) and line (0,0,0)+t(0,0,1); // 4: Plane including point (x,y,z) and line (0,0,0)+t(0,1,0); // 5: Plane including point (x,y,z) and line (0,0,0)+t(1,0,0);
switch(angleType1) {
case 0: vecRot.x =1; vecRot.y =0; vecRot.z =0; break;
case 1: vecRot.x =0; vecRot.y =1; vecRot.z =0; break;
case 2: vecRot.x =0; vecRot.y =0; vecRot.z =1; break;
case 3: vecRot.y = -Math.Sin(mult1*phi2); vecRot.x = 0; vecRot.z =-Math.Cos(mult1*phi2); break;
case 4: vecRot.x =-Math.Sin(mult1*phi); vecRot.y =-Math.Cos(mult1*phi); vecRot.z = 0; break;
case 5: vecRot.y = 0; vecRot.x = -Math.Sin(mult1*phi3);; vecRot.z =-Math.Cos(mult1*phi3); break;
}
switch (angleRotationType1) { case 0: vecRot.angle =0; break;
case 1: vecRot.angle =mult2*phi; break;
case 2: vecRot.angle =mult2*phi2; break;
case 3: vecRot.angle =mult2*phi3; break;
}
vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z; r=1;
if(power==0) { r=1; } else if(power==0.5) { r = Math.Sqrt(xx + yy + zz); } else if(power==1) { r=xx+yy+zz; } else { r=Math.Pow(xx+yy+zz,power); }
x *= r; y *= r; z *= r; }
// ********************************* // 2. Rotation // *************************************
if(mult4!=0) {
phi = Math.Atan2(z, x); phi2 = Math.Atan2(z, y); phi3 = Math.Atan2(z, x);
switch(angleType1) {
case 0: vecRot.x =1; vecRot.y =0; vecRot.z =0; break;
case 1: vecRot.x =0; vecRot.y =1; vecRot.z =0; break;
case 2: vecRot.x =0; vecRot.y =0; vecRot.z =1; break;
case 3: vecRot.y = -Math.Sin(mult3*phi2); vecRot.x = 0; vecRot.z =-Math.Cos(mult3*phi2); break;
case 4: vecRot.x =-Math.Sin(mult3*phi); vecRot.y =-Math.Cos(mult3*phi); vecRot.z = 0; break;
case 5: vecRot.y = 0; vecRot.x = -Math.Sin(mult3*phi3);; vecRot.z =-Math.Cos(mult3*phi3); break;
}
switch (angleRotationType1) { case 0: vecRot.angle =0; break;
case 1: vecRot.angle =mult4*phi; break;
case 2: vecRot.angle =mult4*phi2; break;
case 3: vecRot.angle =mult4*phi3; break;
}
vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;
r=1;
if(power==0) { r=1; } else if(power==0.5) { r = Math.Sqrt(xx + yy + zz); } else if(power==1) { r=xx+yy+zz; } else { r=Math.Pow(xx+yy+zz,power); }
x *= r; y *= r; z *= r; }
// *********************************** // 3. Rotation // ***********************************
if(mult6!=0) {
phi = Math.Atan2(z, y); phi2 = Math.Atan2(z, x);
phi3 = Math.Atan2(z, x);
switch(angleType1) {
case 0: vecRot.x =1; vecRot.y =0; vecRot.z =0; break;
case 1: vecRot.x =0; vecRot.y =1; vecRot.z =0; break;
case 2: vecRot.x =0; vecRot.y =0; vecRot.z =1; break;
case 3: vecRot.y = -Math.Sin(mult5*phi2); vecRot.x = 0; vecRot.z =-Math.Cos(mult5*phi2); break;
case 4: vecRot.x =-Math.Sin(mult5*phi); vecRot.y =-Math.Cos(mult5*phi); vecRot.z = 0; break;
case 5: vecRot.y = 0; vecRot.x = -Math.Sin(mult5*phi3);; vecRot.z =-Math.Cos(mult5*phi3); break;
}
switch (angleRotationType1) { case 0: vecRot.angle =0; break;
case 1: vecRot.angle =mult6*phi; break;
case 2: vecRot.angle =mult6*phi2; break;
case 3: vecRot.angle =mult6*phi3; break;
}
vecRot.Normalize(); pos=new Fractrace.Geometry.Vec3(x,y,z); newPos= vecRot.getTransform(pos); x = newPos.X; y = newPos.Y; z = newPos.Z; xx = x * x; yy = y * y; zz = z * z;
r=1; if(power==0) { r=1; } else if(power==0.5) { r = Math.Sqrt(xx + yy + zz); } else if(power==1) { r=xx+yy+zz; } else { r=Math.Pow(xx+yy+zz,power); }
x *= r; y *= r; z *= r; }
// Rotation ends:
y += bj; x += br; z += bi;
if(r!=0) { additionalPointInfo.red+=xx/r; additionalPointInfo.green+=yy/r; additionalPointInfo.blue+=zz/r; }
if (r > gr) { tw = n; break; } }
// Switch inner and outer view if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw); }
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #13 on: November 03, 2010, 09:02:59 PM » |
|
// My fractal is ill:
public override void Init() { base.Init(); // Hier kann z.B. pow oder gr aus den Einstellungen gelesen werden.
additionalPointInfo=new AdditionalPointInfo(); }
public override long InSet(double ar, double ai, double aj, double br, double bi, double bj, double bk, long zkl, bool invers) {
double gr=2; int pow = 2; double xx, yy, zz; long tw; int n;
double x=ar,y=ai,z=aj; double r_n = 0;
xx = x * x; yy = y * y; zz = z * z; tw = 0L; double r = Math.Sqrt(xx + yy + zz);
additionalPointInfo.red=0;additionalPointInfo.green=0;additionalPointInfo.blue=0; for (n = 1; n < zkl; n++) {
double r_xy=Math.Sqrt(xx+yy);
//1. Runde double a = 1; if(r_xy!=0.0) a= 1 - zz *( r_xy);
y=2 *x*y*a; x = (xx - yy) * a; z = 2 * z * r_xy;
double tempX=x; x=y; y=z; z=tempX;
xx = x * x; yy = y * y; zz = z * z;
// 2.Runde a = 1; if(r_xy!=0.0) a= 1 - zz *( r_xy);
y=2 *x*y*a; x = (xx - yy) * a; z = 2 * z * r_xy;
tempX=x; x=y; y=z; z=tempX;
xx = x * x; yy = y * y; zz = z * z;
// 3.Runde a = 1; if(r_xy!=0.0) a= 1 - zz *( r_xy);
y=2 *x*y*a; x = (xx - yy) * a; z = 2 * z * r_xy;
tempX=x; x=y; y=z; z=tempX;
x+=br; y+=bi; z+=bj;
xx = x * x; yy = y * y; zz = z * z; r = Math.Sqrt(xx + yy + zz); if(n>3 && n<50) {
if(x>0) additionalPointInfo.red+=x/r; if(y>0) additionalPointInfo.green+=y/r; if(z>0) additionalPointInfo.blue+=z/r;
if(x<0) additionalPointInfo.red-=x/r; if(y<0) additionalPointInfo.green-=y/r; if(z<0) additionalPointInfo.blue-=z/r; }
// Farbwert nach oben fixieren if(additionalPointInfo.red>10000) additionalPointInfo.red=10000; if(additionalPointInfo.green>10000) additionalPointInfo.green=10000; if(additionalPointInfo.blue>10000) additionalPointInfo.blue=10000;
if (r > gr) { tw = n; break; }
}
if (invers) { if (tw == 0) tw = 1; else tw = 0; } return (tw);
}
|
|
|
|
Logged
|
|
|
|
trafassel
Fractal Bachius

Posts: 531
|
 |
« Reply #14 on: November 04, 2010, 10:08:48 PM » |
|
Same Gestalt as in Reply #12.
|
|
|
|
Logged
|
|
|
|
|