Skip to content

Fix Circular Motion: derive velocity from centripetal force instead of forcing constant speed#360

Open
Siddhant52 wants to merge 1 commit into
physicshub:mainfrom
Siddhant52:fix-circular-motion-physics
Open

Fix Circular Motion: derive velocity from centripetal force instead of forcing constant speed#360
Siddhant52 wants to merge 1 commit into
physicshub:mainfrom
Siddhant52:fix-circular-motion-physics

Conversation

@Siddhant52

Copy link
Copy Markdown

Closes part of #40

Problem: In CircularMotion.jsx, the centripetal force was correctly calculated (F = ma) and applied via applyForce(), but the velocity was then immediately overridden every frame with setMag(speed). This meant the force calculation had no real effect on the motion — it was purely decorative for the visual arrow, and the circular path came from the artificial override, not actual physics.

Fix: Replaced the hard override with a gentle correction (5% per frame) that lets the applied centripetal force genuinely drive the velocity's rotation, while still correcting for small numerical drift so the orbit doesn't spiral over many frames.

Testing: Ran the simulation for 15-20+ seconds — orbit stays stable with no visible spiral-in or spiral-out. Confirmed the path remains a clean circle.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@Siddhant52 is attempting to deploy a commit to the PhysicsHub's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant