You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// up to here the calcuation was made as if the x-values were -1, 0, 1.
// This is why below they are shifted by -1
if (x1==x2) {
*dxret= (x1-1) *dx;
*dxret2= (x1-1) *dx;
return1;
}
if (x1 >=0&&x1<1&&x2 >= 0&&x2<1) {
if (x1>x2) { // two zeroes, order return values
*dxret= (x2-1) *dx;
*dxret2= (x1-1) *dx;
} else {
*dxret= (x1-1) *dx;
*dxret2= (x2-1) *dx;
}
return2;
}
if (x1 >=0&&x1<1) {
*dxret= (x1-1) *dx;
*dxret2= (x2-1) *dx; // set this value just in case, should not be used.
return1;
}
if (x2 >=0&&x2<1) {
*dxret= (x2-1) *dx;
*dxret2= (x1-1) *dx;
return1;
}
return0; // should not happen!
}
A "parabola fit" is often mentioned in the swisseph forum, and I believe it's using the above. Unlike interpolation, it requires bracketing and some cajoling of values into it to account for "circle jumps," and out of it to actually find the equivalent date value; the gain being that it doesn't require as many ephemeris IO events as regular interpolation. This method is also able to detect double crossings, which we currently don't do (though the tools are there! See the comments for crossingBetween)
The text was updated successfully, but these errors were encountered:
See:
swiss-ephemeris/csrc/swevents.c
Lines 1676 to 1722 in 169e3df
A "parabola fit" is often mentioned in the swisseph forum, and I believe it's using the above. Unlike interpolation, it requires bracketing and some cajoling of values into it to account for "circle jumps," and out of it to actually find the equivalent date value; the gain being that it doesn't require as many ephemeris IO events as regular interpolation. This method is also able to detect double crossings, which we currently don't do (though the tools are there! See the comments for
crossingBetween
)The text was updated successfully, but these errors were encountered: