TyCHO

Trajectories, as pages you can turn.

With TyCHO, trajectories computed by any library become animated pages. Each page is one HTML file that works offline and on a phone.

The Earth–Moon L1 halo family in the rotating frame, with the members of JPL’s catalog colored by their Jacobi constant. The bold orbit is also drawn in the inertial frame of the Earth, in which it closes after 5 revolutions, i.e. after 2 months. Drag to turn it.

How it works

You compute the trajectories with the library of your choice and hand them to pytycho as NumPy arrays. pytycho writes them into one HTML file, together with the runtime that draws them.

The file opens from disk, without a server or a network. It can be turned, played, and paused in Chrome, Firefox, and Safari, on a desktop or a phone, and put on a slide of a talk.

pip install pytycho
import numpy as np
import pytycho as ty

scene = ty.Scene(title="an orbit")
rotating = scene.frame("rotating", axes=("x", "y", "z"))
orbit = scene.trajectory_set("orbit", frame=rotating, periodic=True)
t = np.linspace(0.0, 2.0 * np.pi, 400)
orbit.add(np.column_stack([np.cos(t), 0.5 * np.sin(t)]))
scene.clock(channels=["@index"], frame_count=200)
scene.panel("main", frame=rotating, reference=ty.reference(orbit, 0),
            layers=[ty.trajectories(orbit, 0, trail=0.3, head=True)])
scene.write_html("orbit.html")

Tools