The distlink MOID library and example driver build as standard C++20.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
The moid executable runs the example from main.cpp. A direct compiler
invocation is also supported:
g++ -std=c++20 main.cpp distlink.cpp -O3 -march=native -mfpmath=sse -o moid
Do not enable -ffast-math; it invalidates numerical assumptions used by the
root solver and its error checks.
Orbital elements and numerical options must be finite. Eccentricity must be
nonnegative and exactly parabolic orbits (e == 1) are rejected. A nonzero
semimajor axis is canonicalized to positive for an ellipse and negative for a
hyperbola. Invalid inputs throw std::invalid_argument.
MOID_fast is deterministic and supports circular first orbits directly: it
automatically exchanges the pair when only the first orbit is circular and
uses the exact two-circle solution when both are circular.
The direct scanner uses a full anomaly range for coplanar elliptic orbits. It
rejects a coplanar hyperbolic pair because no finite scan interval can in
general bound both unbounded branches; use MOID_fast for that case.