Shop Mobile More Submit  Join Login
The Golden Donnut by Aexion The Golden Donnut by Aexion
Like the Golden Apple.. but with more calories

The equation is:

bool GoldenDonnut(float x, float y, float z,int Iter)
{

int ic;
const float delta=0;
const float angle=atan2(ny,nx)*3;
const float radius=sqrt(nx*nx+ny*ny);
const float t_radius=radius-3.5;
const float ctx =sinf(angle)*radius-delta;
const float cty =cosf(angle)*radius-delta;
const float ctz =nz-delta;
const float ctw =t_radius*t_radius+nz*nz-delta;
float w=ctw;
x=ctx;
y=cty;
z=ctz;
for(ic=0;ic<Iter;ic++){
if(x>1)x=2-x;
else
if(x<-1)x=-2-x;
if(y>1)y=2-y;
else
if(y<-1)y=-2-y;
if(z>1)z=2-z;
else
if(z<-1)z=-2-z;
if(w>1)w=2-w;
else
if(w<-1)w=-2-w;

const float vm=sqrt(x*x+y*y+z*z+w*w);
if(vm<0.5){
x*=4;
y*=4;
z*=4;
w*=4;
} else
if(vm<1){
const float vsq=vm*vm;
x/=vsq;
y/=vsq;
z/=vsq;
w/=vsq;
}
x=x*2+ctx;
y=y*2+cty;
z=z*2+ctz;
w=w*2+ctw;
if ((x*x+y*y+z*z+w*w)>3600) break;
}
if(ic<Iter)return false;else return true;

}


Hope that Spring ends soon!! :sneeze:
I really want to breathe again!! :blownose:
Add a Comment:
 
:iconnignag:
NigNag Featured By Owner Jul 3, 2011
Outstanding
Reply
:iconaexion:
Aexion Featured By Owner Jul 4, 2011
Thanks!! :thanks:
Reply
:iconthunder7:
thunder7 Featured By Owner Jun 14, 2011  Hobbyist Artist
WOW Ur just keep Blowing my Mind!
Reply
:icondark-beam:
dark-beam Featured By Owner Jun 3, 2011  Student Artist
Arg, really awesome! Too bad my pc is not working fine those days and too few time; link sent to Jesse!

God bless you friend :hug: sorry for the laaaaaaate reply :shrug:
Reply
:icondmaland:
dmaland Featured By Owner May 24, 2011  Hobbyist Digital Artist
High calorie fractal treats! Woo! :D
Reply
Add a Comment:
 
×



Details

Submitted on
May 24, 2011
Image Size
1.1 MB
Resolution
1024×1024
Link
Thumb
Embed

Stats

Views
463
Favourites
10 (who?)
Comments
5
Downloads
13
×