Measure · fit · check

Measure gravity with your phone.

Film a ball drop, a throw or a pendulum. From the video, PhysicsLens tracks the ball, fits the physics with SciPy, and a Meta Muse Spark agent checks the fit before you see a number.

120 fps · shown at ¼ speed · n = 0 · seed 7drag back to throw · keys: ←→ speed 3.4 m/s · ↑↓ angle 60° · Enter throws · Space pauses

How it works

From a phone video to a checked number

  1. 1

    Film

    A phone on a stand, the ball, and something of known length in the same plane: a ruler or a sheet of A4.

  2. 2

    Track

    A motion or colour tracker finds the ball in every frame. When they lose it, Meta SAM 3.1 segments and follows it.

  3. 3

    Fit

    SciPy fits a fall, a throw or a swing to the track and gives g, the landing point or the length, with an uncertainty.

  4. 4

    Check

    A Meta Muse Spark agent calls the fit and check tools, rejects fits that fail, and explains what it kept. It never writes the numbers.

Step 4 on a real clip · Commons pendulum, 105 points
  1. describe_track()
    → 105 points over 4.16 s · x swings at 0.659 Hz
  2. fit_pendulum(axis="x")
    → fit_1 · ω 4.078 rad/s · R² 0.994
  3. check_plausibility("fit_1")
    → flagged: residuals are structured (runs z = −7.2)
  4. fit_free_fall · fit_projectile · fit_pendulum(y)
    → R² 0.027 · 0.015 · 0.862: all rejected
  5. final_answer("fit_1", accept_flagged)
    → L = 0.590 m (tape: 0.60 m), the flag explained

In this run (Oct 28) Muse tried four models, rejected three, and kept the swing fit with its flag stated. With today's stricter rules it declines to certify the same fit and says why: the residuals are not random. Either way the length comes from the fit, not from the model's text.

Try it

Why fit the swing instead of using a formula

T exact
1.566 s
2π√(L/g)
1.554 s
L from T
0.609 m

At 20° the swing is 0.8% slower than the small-angle formula: read L from that formula and it comes out 1.5% too long. That is why PhysicsLens fits the swing instead.

Results

How accurate is it?

Gravity from a dropped ball

g · m/s²
9.81
9.5010.10
  • BallDrop · motion tracker9.728 ± 0.021−0.8%23 points · ± fit only · R² 1.0000
  • BallDrop · SAM 3.1 box9.653 ± 0.065−1.6%13 points · ± fit and scale reading

Pendulum length from its swing

L · m
tape 0.60
0.500.70
  • Commons pendulum · SAM 3.1 + fit0.590−1.6%105 points · R² 0.994 · flagged: structured residuals
Measured from video against the reference. Two clips, not a benchmark; ± is the fit (and scale reading where stated), perspective not included.
ClipQuantityMeasuredReferenceError
BallDrop · motion trackerg9.728 m/s²9.81 m/s²-0.8%
BallDrop · SAM 3.1 boxg9.653 m/s²9.81 m/s²-1.6%
Commons pendulum · SAM 3.1 + fitlength L0.590 m0.60 m (tape)-1.6%

Pendulum clip: “Fadenpendelgeschwindigkeit (2 grad)” by Mathe-AC Lernwerkstatt Aachen (Rhetos), Wikimedia Commons, CC BY-SA 4.0. BallDrop: Open Source Physics Tracker sample.

Built with

Meta models where they help, SciPy for the numbers

  • Meta SAM 3.1

    Segments and follows the ball from one box, when the motion tracker loses it.

  • Meta Muse Spark

    The agent: calls the fit and check tools, rejects bad fits, writes the explanation.

  • SciPy

    The numbers: deterministic least-squares fits, never generated text.

FAQ

Frequently asked questions

How does PhysicsLens measure g from a video?

It finds the ball in every frame, turns pixels into metres with a length you mark on the video (two clicks on a ruler), and fits y = y0 + v0·t + g·t²/2 with SciPy. The fitted g comes with an uncertainty from the fit and from reading the scale.

How accurate is it?

On the BallDrop sample video it measured g = 9.728 m/s², 0.8% below 9.81. On a Wikimedia Commons video of a 0.60 m pendulum it measured L = 0.590 m, 1.6% short. These are two clips, not a benchmark; the depth difference between the ball and the ruler is the main remaining error.

What do I need to film an experiment?

A phone held still, side-on to the motion, and something of known length in the same plane as the ball. Slow motion helps: give its real frame rate, for example 240 fps, so the clock is right.

What do Meta SAM 3.1 and Meta Muse Spark do here?

SAM 3.1 segments and follows the ball when you box it, or when the simple trackers lose it. Muse Spark is an agent that calls the fit and check tools, rejects fits that fail the checks, and explains the result. The numbers always come from SciPy, never from the model's text.

Is my video uploaded anywhere?

The app runs on your own computer and keeps its runs there. The clip is sent to the Meta Model API only when you choose the SAM 3.1 tracker; the Muse agent receives the tracked positions and fit results, not the video.

Get the code

Run it on your computer

PhysicsLens runs locally: a Python server with the trackers and fits, and this web app. Set MODEL_API_KEY in .env for the Meta models, then start physicslens-ui.

Source code on GitHub