Physics
Rotation and tumbling
Fixed-axis spin and torque-free motion.
Fixed-axis spin
Section titled “Fixed-axis spin”The body turns by 2π t / P about an axis fixed in the body frame (given by its azimuth from +X toward +Y and its elevation toward +Z), after the attitude law and the Euler angles.
Free tumbling
Section titled “Free tumbling”A body spinning about an axis that is not a principal axis of inertia does not keep that axis: it precesses and nutates, and its light curve is not strictly periodic. LightCurve integrates Euler’s torque-free equations:
I · dω/dt = −ω × (I · ω) (body frame, principal axes = body axes)dq/dt = ½ q ⊗ (0, ω) (attitude quaternion)with a fixed-step fourth-order Runge–Kutta scheme, quaternions interpolated spherically between steps, and states cached. Energy and angular momentum are conserved to the integration accuracy (tested); a spin about the major axis stays stable, a spin about the intermediate axis flips.
Inputs: the three principal moments of inertia (relative; they can be estimated from the bounding box of the model, taken as a full homogeneous box), the initial axis and the initial period.