
function Ekliptik() {
  Kmond = (125.0445 - 1934.13626*T)*Math.PI/180; 
  EKL = (23.43929 - 0.013004*T + 0.00256*Math.cos(Kmond))*Math.PI/180;
  }

function Sonne() {
  Ls = (280.46645 + 36000.76983*T)/360;
  Ls = 2*Math.PI*(Ls-Math.floor(Ls));
  Ms = (357.52910 + 35999.05030*T)*Math.PI/180;
  var es = 0.016708617 - 0.000042037*T;
  Cs = (1.914600 - 0.004817*T)*Math.sin(Ms)
  + 0.019993*Math.sin(2*Ms) + 0.000290*Math.sin(3*Ms);
  Cs = Cs*Math.PI/180
  var vs = Ms + Cs;
  Rerde = (0.9997218*(1-es*es))/(1+es*Math.cos(vs));
  lsonne = Ls + Cs;
  lsonne = lsonne - (0.00569 - 0.00478*Math.sin(Kmond))*Math.PI/180;
  alphasonne = Math.atan((Math.sin(lsonne)*Math.cos(EKL))/Math.cos(lsonne));
  if (Math.cos(lsonne)<0) alphasonne = alphasonne + Math.PI
  deltasonne = Math.asin(Math.sin(EKL)*Math.sin(lsonne));
  }


function ZMHoehe() {

   geoBr = 50*Math.PI/180;
   geoL = -10;

   SZ = 6.656306 + 0.0657098242*(JD2-2445700.5) + 1.0027379093 * hh - geoL/15;
   SZ = SZ/24;
   SZ = (SZ - Math.floor(SZ))*24;
   SZ = SZ*Math.PI/12;

   t =  SZ - alphaju;
   hh1= Math.sin(geoBr) * Math.sin(deltaju);
   hh2= Math.cos(geoBr) * Math.cos(deltaju) * Math.cos(t);
   hh= Math.asin(hh1+hh2);
   Hoehe=180*hh/Math.PI;

   t =  SZ - alphasonne;
   hh1= Math.sin(geoBr) * Math.sin(deltasonne);
   hh2= Math.cos(geoBr) * Math.cos(deltasonne) * Math.cos(t);
   hh= Math.asin(hh1+hh2);
   HoeheSonne=180*hh/Math.PI;

   var x = Math.round(zm1*10)/10;  
   var rest = x - Math.floor(x);
   if (rest==0) x=x+".0" 
   ZM1 = x;     
   var x = Math.round(zm2*10)/10; 
   var rest = x - Math.floor(x);
   if (rest==0) x=x+".0" 
   ZM2 = x; 
        
   if ((Hoehe>5) && (HoeheSonne<-5)) 
   {ZMma1 = ZM1 + "&#160;"; ZMma2 = ZM2 + "&#160;";}
   else
   {ZMma1 = "&#160;"; ZMma2 = "&#160;";}
}


function Ausgabe() {

	rv = Math.round(r*100)/100;
	var x = lambda/360;
        x = x - Math.floor(x); el = x*360;
	el = Math.round(el*10)/10;	
        eb = Math.round(beta*10)/10;
	Ds = Math.round(Ds*10)/10;
	Du = Math.round(Du*10)/10;
        mv = Math.round(mv*10)/10;

	var x = alphaju/(2*Math.PI); x = x - Math.floor(x); x = x*360; if (x<0) x = x +360;
	var rah = x/15;
	var ram = (rah-Math.floor(rah))*60;
	ram = Math.floor(ram); if (ram<10) ram = "0" + ram;
	Rekt = Math.floor(rah)+":"+ram + "&#160;";
	de = deltaju*180/Math.PI;
	var x = Math.round(10*de)/10;
	var rest = x - Math.floor(x);
	if (rest==0) x=x+".0"
	Dekl = x;

	x = Math.round(10*mv)/10;        
	var rest = x - Math.floor(x);
	if (rest==0) x=x+".0"
	Helligkeit = x;

	x = Math.round(10*Du)/10;         
	var rest = x - Math.floor(x);
	if (rest==0) x=x+".0"
	Durchmesser = x +'"'+"&#160;";

	x = Math.round(10*Du*0.9333)/10;        
	var rest = x - Math.floor(x);
	if (rest==0) x=x+".0"
	DurchmesserP = x +'"'+"&#160;";

	x = Math.round(1800*phi/Math.PI)/10;         
	var rest = x - Math.floor(x);
	if (rest==0) x=x+".0"
	Phasenwinkel = x;

	x = Math.round(100*r)/100;         
	AbstandSonne = x;

	x = Math.round(100*delta)/100;         
	AbstandErde = x;

	Derde = Math.round(100*De)/100;       
	Dsonne = Math.round(100*Ds)/100;       

}