Add a Spherical Integrator in 3D cartesian coordinates

Hello everyone,

I recently opened an issue to contribute and implement Coppola’s 2012 method to calculate a probability of collision adapted to long term encounters, where a spherical integration nested with a temporal one is needed.

I tested my implementation with the current available univariate integrators and they fail to converge. Coppola advises to use Lebedev Quadrature. Retrieving the implementation from a C++ code and adapting it in java, it finally works, but I don’t know where to put it, probably in Hipparchus’s ‘hipparchus-core/src/main/java/org/hipparchus/analysis/integration’. It is a bit particular, as it’s not a trivariate integrator but a 2D spherical one, and it takes in input a function in 3D cartesian coordinates.

I opened an issue and created a merge request in Hipparchus to add the java implementation.

Did you check the license of the C++ code you used before translating it?

Answering to myself.
Can you confirm your used this?

If so, it is a clear no. We cannot use LGPL code in Hipparchus/Orekit.

It’s a MIT license, the code is available here:

sphere_lebedev_rule

Hi Luc, hi Nicolas,

In my humble opinion, this contribution poses no problem for three reasons:

  1. It is a rewriting of the original code in another language. In other words, the algorithm was deduced from the documentation and the C++ code and implemented in Java. The Java code is considered an original work and not a derivative work.
  2. Even if Nicolas had asked for help from an AI, case law is consistent worldwide: no one can claim any copyright over code generated by AI unless he/she:
    • Demonstrate that the generated code is nothing more than a copy of his/her code (in that case, it would be the copyright holder of the original code who might complain);
    • Substantially modify the AI-generated code after it has been generated, thereby establishing copyright.
  3. On the website, there is no mention of a patent on the underlying algorithm. Even if such a patent ever existed, it has expired because the algorithm was published in a book in 1999.

For all these reasons, this contribution can reasonably be integrated into the Hipparchus code.