Inspiration
Every physics student has drawn a ball on a ramp, but a drawing just sits there. We wanted the sketch itself to come alive, so students can see the physics, change it, and understand why it behaves that way.
What it does
Draw a ramp and a ball on paper and snap a photo. PaperPhysics recognizes the drawing, runs it as a physics simulation, and checks the result against the textbook formula. Drag the ramp to change the angle, double the mass, and a “why” card explains what changed. An AI tutor answers questions using only numbers the simulation has verified, and a QR code lets you take your animation home as a GIF.
How we built it
OpenCV reads the sketch: it flattens the paper, extracts the ink, and detects the ramp and ball. pymunk runs the simulation, and SymPy derives the formulas and checks every prediction against the simulated result. A FastAPI backend serves a mobile-friendly React web app. The AI tutor runs on a model through OpenRouter and is grounded in the simulation’s own numbers.
Challenges we ran into
Real sketches are messy: ruled notebook paper, blue ballpoint pen, drawings photographed sideways, and extra marks like arrows and labels. Synthetic training images looked nothing like real phone photos, so we tuned on real ones. Matching a 2D physics engine to the textbook rolling formula was trickier than expected.
Accomplishments that we’re proud of
A photo of a hand-drawn sketch becomes a running simulation in seconds. Every run is checked against the textbook formula, and anything off by more than 3% is flagged. The AI tutor never invents a number: every figure it gives comes from the physics engine, and a built-in checker flags anything that doesn’t match.
What we learned
Classic computer vision can beat a trained model when the problem is narrow. Grounding an LLM in verified data matters more than which model you use. And building with AI agents works best with a detailed plan and clear rules for how the pieces fit together.
What’s next for PaperPhysics
More situations (blocks, springs, collisions, pendulums), more reliable reading of handwritten values, and classroom features so teachers can share sketches and see what students explore.
Built With
- claude-code
- cloudflare
- computer-vision
- fastapi
- html5
- javascript
- katex
- numpy
- nvidia-nemotron
- opencv
- openrouter
- pillow
- pydantic
- pymunk
- python
- react
- sympy
- typescript
- uvicorn
- vite