Two-body Keplerian orbit propagation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+31 -8
+22 -8
README.md
··· 6 6 7 7 ## Installation 8 8 9 + Install with opam: 10 + 11 + ```shell 12 + $ opam install kepler 9 13 ``` 10 - opam install kepler 14 + 15 + If opam cannot find the package, it may not yet be released in the public 16 + `opam-repository`. Add the overlay repository, then install it: 17 + 18 + ```shell 19 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 20 + $ opam update 21 + $ opam install kepler 11 22 ``` 12 23 13 24 ## Usage 14 25 15 26 ```ocaml 16 - (* Analytic propagation with precomputed elements (fast path) *) 17 - let elems = Kepler.Analytic.precompute ~pos ~vel in 18 - let new_pos = Kepler.Analytic.at_precomputed elems ~dt:3600. in 19 - Printf.printf "Period: %.1f s\n" (Kepler.Analytic.period elems) 20 - 21 - (* Generate an orbit arc for visualization *) 22 - let arc = Kepler.Analytic.arc ~pos ~vel ~duration_s:5400. ~num_points:360 27 + let propagate pos vel = 28 + (* Analytic propagation with precomputed elements (fast path) *) 29 + let elems = Kepler.Analytic.precompute ~pos ~vel in 30 + let new_pos = Kepler.Analytic.at_precomputed elems ~dt:3600. in 31 + Printf.printf "Period: %.1f s\n" (Kepler.Analytic.period elems); 32 + (* Generate an orbit arc for visualization *) 33 + let arc = 34 + Kepler.Analytic.arc ~pos ~vel ~duration_s:5400. ~num_points:360 35 + in 36 + (new_pos, arc) 23 37 ``` 24 38 25 39 ## API Overview
+6
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files 7 + README.md 8 + ) 9 + (libraries kepler))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 (name kepler) 3 4 (source (tangled gazagnaire.org/ocaml-kepler)) 4 5 (formatting (enabled_for ocaml)) ··· 15 16 (tags (org:blacksun aerospace math simulation)) 16 17 (depends 17 18 fmt 19 + (mdx :with-test) 18 20 vec3))
+1
kepler.opam
··· 10 10 depends: [ 11 11 "dune" {>= "3.21"} 12 12 "fmt" 13 + "mdx" {with-test} 13 14 "vec3" 14 15 "odoc" {with-doc} 15 16 ]