我一直在关注本指南,将其移植到 javascript: http: //www.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/
直到 9 点(赤经)和 10 点(赤纬),一切都顺利进行。我无法重新创建他们为这些给出的答案。
(9) 寻找太阳赤经的阿尔法: (a) 开普敦:
lambda = 326.186
epsilon = 23.4396
alpha = arctan (tan(lambda) x cos(epsilon)) // in same quadrant as lambda
// THEIR RESULT
alpha = 328.428
// MY RESULT
var DEGREES = function (val) {
return val / (Math.PI / 180);
};
var alpha = Math.atan(Math.tan(lambda) * Math.sin(epsilon));
alpha = 0.495;
alpha = DEGREES(0.495) = 28.39;
我也试过:
var alpha = Math.atan2(Math.tan(lambda) * Math.sin(epsilon), lambda);
alpha = DEGREES(result) = 1.321;
差远了!
和 10(a),偏角
delta = arcsin (sin(lambda) x sin(epsilon))
// THEIR RESULT
(a) delta = -12.789
// MY RESULT
var result = Math.asin(Math.sin(eclipticLong) * Math.sin(obliq));
result = DEGREES(result);
result = -10.966;
正如你所看到的,我正抓着稻草,因为我对此一无所知。任何帮助将非常感激。