[Kstars-devel] Predicting conjunctions

Akarsh Simha akarshsimha at gmail.com
Tue Mar 18 13:14:56 CET 2008


Dear Jan,

> Java implementation is here:
> http://opencoeli.googlecode.com/svn/trunk/opencoeli/src/main/java/org/opencoeli/utils/Minimax.java

When we change the direction of step2 (as in step2 = -step2 / 10) in
the above implementation, is it not required to change lastSignum to
-lastSignum, because now the direction of step is opposite, which
means that (value - lastValue) will change sign even though we don't
cross an extremum?

I implemented the algorithm with the lastSignum = -lastSignum;
statement for finding the extrema of some simple cubic as a test
function, and it seems to work pretty well. However, the same
algorithm, without making the change goes off track.
I've pastebin'd the code here: http://pastebin.com/m297d1bc4
And the sample output is here: http://pastebin.com/m66aceab7
The function used was x * (1 - x) * (1 + x).

Regards
Akarsh.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20080318/0859c227/attachment.pgp 


More information about the Kstars-devel mailing list