MeeusJs icon indicating copy to clipboard operation
MeeusJs copied to clipboard

Error in example

Open jumpjack opened this issue 2 years ago • 0 comments

Error highlighted below (in example on home page):

// gets the moon position and times for zurich
var jdo = new A.JulianDay(new Date()); // now
var coord = A.EclCoord.fromWgs84(47.3957, 8.4867, 440); // zurich

// gets the position of the moon		
var tp = A.Moon.topocentricPosition(jdo, coord, true);
// print azi and alt
console.log(tp.hz.toString() + ", dist:" + tp.delta); 

// gets the rise, transit and set time of the moon for today
var times = A.Moon.times(jdo, coord);
	
// print rise, transit and set in universal time	
console.log("rise:" + A.Coord.secondsToHMSStr(times.rise) + 
          ", transit:" + A.Coord.secondsToHMSStr(times.transit) + 
          ", set:" +  A.Coord.secondsToHMSStr(times.set));
		  

// print moon phase and illuminated
var suneq = A.Solar.apparentTopocentric(jdo, coord);
var i = A.MoonIllum.phaseAngleEq2(tp.eq, suneq);
var k = A.MoonIllum.illuminated(i);
var chi =  A.MoonIllum.positionAngle(moontp.eq, suneq); //////////////////// ERROR! "moontp" is not defined, it should be just "tp"

console.log("phase:" + i + ", illuminated:" + k + ", angle:" + chi);	

jumpjack avatar Mar 01 '23 08:03 jumpjack