MooseMindWorks
← All projects

Physics

Track Physics

I wanted something for the portfolio. To be honest, it’s useless to me. Pick four cars from the collection of 118, lay out some orange track and see which ones make it through the loop.

Race

Pick the cars, then press Race. Build your own run in the editor under the lanes and the track rebuilds as you go. Slow motion and the force arrows show what is actually happening in a loop.

t = 0.000 s

Track editor

Start from
    Add after the selected piece

    What the physics does

    Each car rides the track as a mass on a curve. Along the track, gravity pulls it downhill and two things pull back: rolling resistance from the wheels and axles, which grows with how hard the track is pushing, and air drag, which grows with the square of speed. Across the track, the only question is whether the track still has to push. On a crest or near the top of a loop the push needed is g·cos θ + v²·κ, gravity's share plus the curve's, and the moment that goes negative the car is no longer on the track. It flies, and the sandbox switches it to a ballistic arc until it lands, hits the floor, or lands too hard and crashes.

    That's where the loop rule comes from. At the top of a loop of radius r the car needs v² ≥ g·r just to stay pressed against the track, and without friction that takes a start at least 2.5 r above the bottom of the loop. Friction makes the real number bigger. Run “Too low for the loop” to watch the rule fail.

    Mass mostly cancels. Gravity and rolling resistance both scale with the car's weight, so on their own a heavy car and a light one run identically. Only air drag breaks the tie, and it favours the heavy car. Wheels matter more than weight: plastic wheels roll easier than rubber Real Riders.

    What's estimated. Weights are estimates until I weigh the cars: 48 g for a premium, 32 g for a mainline. Wheel type follows the premium flag. Rolling resistance is 0.020 for plastic and 0.034 for rubber, and each car gets a fixed “axle luck” factor between 0.85 and 1.15, seeded from its photo name, because real cars with identical specs still run differently and identical specs would otherwise tie every time. None of these coefficients were measured.

    Specification

    Model
    Point mass on a curve, with a ballistic flight mode when the normal force goes negative
    Step
    0.5 ms fixed time step, semi-implicit Euler, 4 mm track sampling
    Gravity
    9.81 m/s²
    Air drag
    ½ ρ Cd A v², with ρ 1.2 kg/m³, Cd 0.5, A 3.6 cm²
    Rolling
    0.020 plastic, 0.034 rubber, times axle luck 0.85–1.15
    Landing
    Velocity along the track is kept; hitting the track faster than 2.6 m/s counts as a crash
    Booster
    Spinning wheels at 4.2 m/s surface speed
    Scale speed
    Measured speed × 64, for what it would be at full size
    Weights
    Estimated, 48 g premium and 32 g mainline, until real grams go in the data

    How it's built

    No physics library. The track is a chain of pieces, each one a list of lines and arcs, sampled every 4 mm into a curve that knows its own angle and curvature. The engine steps every car along its curve 2,000 times a second, checks the normal force at each step, and hands the car to a flight solver the moment it goes negative; landings are found with a spatial grid over the track segments. The cars come from the same data file as the Number Cars page, so the garage grows when the collection does.