I’m trying to implement uniform circular motion for a particle simulation using vector math. My goal is to have particles follow a circular path with the option to deviate inward or outward, and I want to control the centripetal force directly. I’ve tried multiple approaches with tangential velocity and centripetal acceleration, but in every case the particles drift inward or outward over time. I know TouchDesigner has a Force Radial POP, but I’d like to solve this purely with vector math for more control.
Has anyone successfully implemented stable circular motion in a particle system using only vector operations? Any guidance, formulas, or step-by-step examples would be hugely appreciated.
uniform_circular_motion.tox (2.0 KB)
Hi there,
If you want your particles to always stay on an exact radius away from your origin (so always following a circle), it’s more stable to set the position exactly instead of integrating over velocity (P.xy = radius*(sin(angle*TAU), cos(angle*TAU))). But something tells me that’s not the goal here and you would like to stay in simulation land 
The problem with simulating this by integrating the velocity vector, is that the integration part is being done numerically. Every frame (1/60 seconds) you do a linear step where the position of the particle moves a bit in a straight line, and then calculating the new forces from that position. This is not exact and will deviate from the circle trajectory, since it’s basically a polygon approximation of the circle. Every step you will be slightly off which will result in particles not staying at the same radius.
In your example, you’re mixing 2 concepts. The cross product you’re doing is calculating the tangental direction on the circle, which is the resulting velocity vector of that timestep. Next, you use this as velocity vector and add a centripetal force, but this velocity vector will be overwritten with the tangental direction every frame. So this addition of the centripetal force isn’t doing much. What you want to do is keep the velocity vector as is and add the centripetal force. The cross product should be only used here to calculate the initial velocity vector. If it were planets orbiting around a sun, the planet will always go in a straight line, the centripetal force will pull it towards the sun, resulting in a velocity vector equal to that cross product.
See the attached tox. I’ve changed this to show what I mean. But also notice that it’s still not perfectly stable, since the numerical approach and discrete steps we take. A bruteforce way to get a bit more stable trajectory is to use a glslPOP to do the math and let it run with multiple passes for smaller stepsizes. (see the switchPOP when set to the second input)
Other way (which I think is the way to go, but depends on your needs), is to use polar coordinates instead. So every particle has a radius and an angular momentum, this way you have perfect control over the radius per particle.
Hope this helps in your math adventures 
Cheers,
tim
uniform_circular_motion_tim.tox (10.2 KB)
2 Likes