xxxxxxxxxx
float m,ms,v,vs,e,es,mz,mzs,ast,asts,j,js,s,ss,u,us,n,ns,p,ps;
int sc,cen;
float[] astPos=new float[360];
boolean showorbit=true;
void setup() {
m = 0.02;
v = 0.015;
e = 0.01;
mz= 0.0085;
ast=0.0009;
j =0.005;
s =0.003;
u =0.001;
n =0.0009;
p =0.0003;
ms= random(360);
vs= random(360);
es= random(360);
mzs=random(360);
asts=random(360);
js= random(360);
ss= random(360);
us= random(360);
ns= random(360);
ps= random(360);
for(int i=0;i<360;i++){
astPos[i]=random(69,95);
}
sc = 130; //edts width of circle
noStroke();
size(700,700);
}
void mousePressed(){
if(mouseButton==RIGHT){
showorbit=(!showorbit);
}
}
void draw() {
translate(width/2,height/2);
background(0);
sunny();
me();
ve();
ea();
ma();
AstBlt();
ju();
sa();
ur();
ne();
pl();
}
void sunny() {
for(int q = 200;q >= 50;q--){
fill(255,100+(q-25),q-50,25);
ellipse(0,0,q-50,q-50);
}
}
void me() {
fill(255,255,0,100);
float x = sin(ms) * (sc-30);
float y = cos(ms) * (sc-30);
ellipse(x,y,8,8);
showOrbit(sc-30,sc-30);
ms += m;
}
void ve() {
fill(150,150,10,100);
float x1 = sin(vs) * (sc-10);
float y1 = cos(vs) * (sc-10);
ellipse(x1,y1,10,10);
showOrbit(sc-10,sc-10);
vs += v;
}
void ea() {
fill(30,30,255,100);
float x2 = sin(es) * (sc+20);
float y2 = cos(es) * (sc+20);
ellipse(x2,y2,13,13);
showOrbit(sc+20,sc+20);
translate(x2,y2);
fill(200);
float Mx=sin(es*2)*(12);
float My=cos(es*2)*(12);
ellipse(Mx,My,3,3);
showOrbit(12,12);
translate(-x2,-y2);
es += e;
}
void ma() {
fill(255,40,40,100);
float x3 = sin(mzs) * (sc+50);
float y3 = cos(mzs) * (sc+50);
ellipse(x3,y3,12,12);
showOrbit(sc+50,sc+50);
mzs += mz;
}
void AstBlt(){
fill(150);
for(int i=0;i<360;i++){
if(i%3==0){
float X=sin(asts+i)*(sc+astPos[i]);
float Y=cos(asts+i)*(sc+astPos[i]);
stroke(75);
strokeWeight(1);
ellipse(X,Y,4,4);
}
else{
float X=sin((-asts)+i)*(sc+astPos[i]);
float Y=cos((-asts)+i)*(sc+astPos[i]);
stroke(75);
strokeWeight(1);
ellipse(X,Y,4,4);
}
}
noStroke();
asts-=ast;
}
void ju() {
fill(200,100,100,100);
float x4 = sin(js) * (sc+115);
float y4 = cos(js) * (sc+115);
ellipse(x4,y4,30,30);
showOrbit(sc+115,sc+115);
js += j;
}
void sa() {
fill(100,100,0,150);
float x5 = sin(ss) * (sc+150);
float y5 = cos(ss) * (sc+150);
ellipse(x5,y5,20,20);
showOrbit(sc+150,sc+150);
translate(x5,y5);
for(float i=0;i<2;i+=.25){
float rng=cos(0)*(12.5+i)*2;
stroke(100,75,25,150);
strokeWeight(1);
noFill();
ellipse(0,0,rng,rng);
}
noStroke();
translate(-x5,-y5);
ss += s;
}
void ur() {
fill(50,50,100,250);
float x6 = sin(us) * (sc+175);
float y6 = cos(us) * (sc+175);
ellipse(x6,y6,13,13);
showOrbit(sc+175,sc+175);
pushMatrix();
translate(x6,y6);
rotate(us*8);
for(float i=0;i<2;i+=.25){
float rng=cos(0)*(9+i)*2;
stroke(0,90,90,150);
strokeWeight(1);
noFill();
ellipse(0,0,sin(radians(25))*(9+i)*2,rng);
}
rotate(-us*8);
translate(-x6,-y6);
popMatrix();
noStroke();
us += u;
}
void ne() {
fill(0,0,255,100);
float x = sin(ns) * (sc+195);
float y = cos(ns) * (sc+185);
ellipse(x,y,10,10);
pushMatrix();
translate(x,y);
for(float i=0;i<.5;i+=.25){
float rng=cos(0)*(8+i)*2;
stroke(200,50);
strokeWeight(1);
noFill();
ellipse(0,0,rng,rng);
}
popMatrix();
showOrbit(sc+195,sc+185);
ns += n;
}
void pl() {
fill(150);
float x = sin(ps) * (sc+215);
float y = cos(ps) * (sc+215);
ellipse(x,y,5,5);
showOrbit(sc+215,sc+215);
ps += p;
}
void showOrbit(float a, float b){
if(showorbit==true){
stroke(175);
strokeWeight(.1);
noFill();
ellipse(0,0,cos(0)*(a)*2,cos(0)*(b)*2);
noStroke();
}
}