Reusable 3D Earth globe widget (pure OCaml + WebGL)
0
fork

Configure Feed

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

ocaml-globe: enable MDX on lib/satellite.mli, replace pseudocode example

The Quick Start was a stack of three pseudocode call-shapes with
free [pos]/[vel]/[color]/[epoch_unix]/[tle]/[state]/[points]
variables. Replaced with a single Kepler-propagation example that
builds a real Satellite.t from a ~6800 km circular-orbit state
vector and asserts on epoch round-trip and the color tuple.

+19 -6
+4
lib/dune
··· 2 2 (name globe) 3 3 (public_name globe) 4 4 (libraries vec3 kepler sgp4 coordinate fmt)) 5 + 6 + (mdx 7 + (files satellite.mli) 8 + (libraries globe vec3))
+15 -6
lib/satellite.mli
··· 3 3 Three constructors for different data sources: 4 4 5 5 {[ 6 - (* From CDM state vector (Kepler propagation): *) 7 - Satellite.of_state_vector ~pos ~vel ~color ~epoch_unix () 8 - (* From TLE (SGP4 propagation): *) 9 - Satellite.of_tle ~tle ~state ~color () 10 - (* From ephemeris points (interpolation): *) 11 - Satellite.of_ephemeris ~points ~color () 6 + open Globe 7 + 8 + (* Kepler propagation from a state vector (~6800 km circular orbit). *) 9 + let sat = 10 + Satellite.of_state_vector 11 + ~pos:(Vec3.v 6800_000.0 0.0 0.0) 12 + ~vel:(Vec3.v 0.0 7660.0 0.0) ~color:(Color.rgb 1.0 0.5 0.0) 13 + ~epoch_unix:0.0 () 14 + 15 + let () = 16 + assert (Satellite.epoch_unix sat = 0.0); 17 + let r, g, b = Color.to_tuple (Satellite.color sat) in 18 + assert (r = 1.0); 19 + assert (g = 0.5); 20 + assert (b = 0.0) 12 21 ]} *) 13 22 14 23 type t