Home / Companies / Frigade / Blog / Post Details
Content Deep Dive

Why I took a physics class as a software engineer

Blog post from Frigade

Post Details
Company
Date Published
Author
Elton Lai-Rego
Word Count
1,825
Language
English
Hacker News Points
-
Summary

A software engineer recounts his unexpected journey into relearning physics principles, specifically spring-damper dynamics, while refining the drag system for the Frigade assistant, which floats to anchor points around a product's viewport. Initially, the engineer relied on a basic setTimeout mechanism to differentiate between clicks and drags, but aiming for a more natural feel led to a deep dive into velocity estimation, numerical integration stability, and kinematics. This exploration involved adjusting the stiffness and damping constants of the spring-damper model to perfect the assistant's behavior, ensuring it accelerates smoothly into anchor points without overshooting or floating. The process also highlighted the importance of maintaining a constant damping ratio relative to mass changes, revealed through hands-on debugging of issues like flicker and unintended assistant behavior due to explicit Euler integration limitations. Ultimately, this led to the development of a dedicated physics module, free from React or DOM dependencies, and comprehensive testing to ensure robust performance.