Hi everyone,
i try to translate a Javascript-Library to Xojo. The following part is the only one, i don’t know, how to do, because Xojo can not handle multiple Arrays. Does anyone of you has an idea?
Greetings
[code]JDE0tab1000 = new Array(
new Array(1721139.29189, 365242.13740, 0.06134, 0.00111, -0.00071),
new Array(1721233.25401, 365241.72562, -0.05323, 0.00907, 0.00025),
new Array(1721325.70455, 365242.49558, -0.11677, -0.00297, 0.00074),
new Array(1721414.39987, 365242.88257, -0.00769, -0.00933, -0.00006)
);
JDE0tab2000 = new Array(
new Array(2451623.80984, 365242.37404, 0.05169, -0.00411, -0.00057),
new Array(2451716.56767, 365241.62603, 0.00325, 0.00888, -0.00030),
new Array(2451810.21715, 365242.01767, -0.11575, 0.00337, 0.00078),
new Array(2451900.05952, 365242.74049, -0.06223, -0.00823, 0.00032)
);
function equinox(year, which)
{
var deltaL, i, j, JDE0, JDE, JDE0tab, S, T, W, Y;
if (year < 1000) {
JDE0tab = JDE0tab1000;
Y = year / 1000;
} else {
JDE0tab = JDE0tab2000;
Y = (year - 2000) / 1000;
}
JDE0 = JDE0tab[which][0] +
(JDE0tab[which][1] * Y) +
(JDE0tab[which][2] * Y * Y) +
(JDE0tab[which][3] * Y * Y * Y) +
(JDE0tab[which][4] * Y * Y * Y * Y);
T = (JDE0 - 2451545.0) / 36525;
W = (35999.373 * T) - 2.47;
deltaL = 1 + (0.0334 * dcos(W)) + (0.0007 * dcos(2 * W));
S = 0;
for (i = j = 0; i < 24; i++) {
S += EquinoxpTerms[j] * dcos(EquinoxpTerms[j + 1] + (EquinoxpTerms[j + 2] * T));
j += 3;
}
JDE = JDE0 + ((S * 0.00001) / deltaL);
return JDE;
}[/code]