This javascript appeared on Googles website on February 19, 2013.
I wondered, whether the google doodle actually integrates the n body problem
as here.
The crucial javascript code is below. The part
this.W=1/Math.sqrt(Math.pow(this.G,3))
looks like a potential. The code is difficult to read. but it seems
that the doodle just animates the world picture at the time of Copernicus
without going into any fancy n body dynamics.
The crucial math part of the Javascript is here:
var $a,ab,bb,
X=function(a,b,c,d){
this.wa=a;this.O=b;
this.P="array"==u(b);
this.G=c;this.va=2*W.getWidth(a);
this.aa=2*W.getHeight(a);this.V=d||0;
this.W=1/Math.sqrt(Math.pow(this.G,3))
},
W=new V("sprite.png",[
[85,30,28,28],
[40,61,42,42],
[0,0,52,53],
[55,0,26,26],
[85,61,36,36],
[0,61,37,37],
[84,0,36,27],
[55,30,27,27]
],{ma:0,oa:1,T:2,U:3,qa:4,ra:5,ta:6,ua:7}),
cb=Math.acos(231/524),
db=Math.sin(cb),
eb=Math.cos(cb),
fb=function(a,b){var c=a.P?a.O:fb(a.O,b);if(0==a.G)return c;
var d=b*a.W+a.V,
e=a.G*Math.sin(d)+c[0],
f=a.G*Math.cos(d),
d=eb*f+c[1],
c=a.P?db*f:c[2]+(0>f?-1:1);a.P||(d-=a.O.aa/3);return[e,d,c]},
gb=function(a){var b=fb(a,Y);return{D:a.wa,x:b[0]-a.va/2,y:b[1]-a.aa,ba:b[2]}};
var Z=m,Y=0,hb=0,$=p,
jb=function(){var a=T(),b=Math.min(a-hb,84);Y+=0.1*b;hb=a;ib();($a=!$)&&Ta(jb)},
ib=function(){
Z.clearRect(0,0,1008,458);
for(var a=W.S,b=[],c=0,d=m,e=0,f;f=bb[e];e++){
var g=gb(f);b.push(g);g.D==a.U&&(c=Math.cos(Y*f.W+f.V),d=g)
}
b.sort(function(a,b){return a.ba-b.ba});
for(e=0;g=b[e];e++)
W.J(g.D,Z,g.x,g.y,2),g.D==a.T&&(
f=Math.min(1,Math.max(0,2*(c+0.5))),1 ≥ f && 0 ≤ f &&
(Z.globalAlpha=f,W.J(d.D,Z,d.x,d.y,2),Z.globalAlpha=1))
};
(function(a,b,c){var d=function(){Xa(a,b,c);Wa(a,b);a()},e=window.google;e&&e.x?e.x({id:"DOODLE"},d):d()})
(function(){
var a=document.getElementById("hplogo");if(a){
var b=document.createElement("canvas");
if(b&&(Oa(b,"height","229px","left","0","position","absolute","top","-10px","width","504px"),
b.setAttribute("height",458),
b.setAttribute("width",1008),
a.innerHTML="",
a.appendChild(b),
a.onclick=Ra,google.doodle&&google.doodle.url&&Oa(b,"cursor","pointer"),
Z=b.getContext("2d"))){
var b=W.S,c=[504,239, 0],
d=new X(b.T,c,184,2.88);
bb=[new X(b.ua,c,64,0.39),
new X(b.qa,c,88,-1.73),
new X(b.ra,c,272,-0.3),
new X(b.oa,c,320,1.86),
new X(b.ma,c,382,-0.89),
new X(b.U,d,72,-1.585),
new X(b.ta,[500,251,0],0),d];
Y=0;hb=T();$=p;$a=k;
var e=new Ya("background.jpg");
e.s();
W.s(function(){Za(e,function(){a.style.background="url("+e.h.src+")";jb()})});
ab=new U(864E5,function(){$=k},function(){$=p;$a||jb()})
}
}
},
function(){$=k;ab&&ab.H()});
})();