0
\$\begingroup\$

I have a Particle p.
A particle consists of a start position p0,an age t, a velocity v and a friction f

How can I find the position pt at an arbitrary t?

I currently have the formula

pt = p0 + (v*t), which works fine.

But I don't know how to corporate f into it.

f is a multiplier, that should reduce velocity per timestep: v' = v*f

I tried p0 + (v*t * (f/t)) but at time 0 it's a division by 0, and when t is high, pt converges to p0

\$\endgroup\$
5
  • \$\begingroup\$ What platform is this for? Ones Like Unity and UnrealEngine already have inbuilt methods for things like this? \$\endgroup\$
    – akaBase
    Oct 1, 2021 at 23:50
  • \$\begingroup\$ @akaBase neither \$\endgroup\$
    – Raildex
    Oct 2, 2021 at 6:21
  • \$\begingroup\$ This is more complicated than it might seem, and I'm not sure whether a closed-form solution exists. \$\endgroup\$
    – DMGregory
    Oct 2, 2021 at 14:01
  • \$\begingroup\$ @DMGregory I see. Thanks. Is there a rough approximation (it doesnt have to be mathematically accurate, it's for visual purposes only) I can use? All I want is slow down the particles according to some parameter and I would like to keep the loop for the particles as tight as possible, without any expensive calculations. \$\endgroup\$
    – Raildex
    Oct 4, 2021 at 5:48
  • \$\begingroup\$ See the bottom of that answer I linked, where I suggest such an approximation for short time steps. \$\endgroup\$
    – DMGregory
    Oct 4, 2021 at 10:55

1 Answer 1

1
\$\begingroup\$

Maybe try this:

pt = p0 + v*t - 0.5ft^2

It's the physical equation for motion with constant deceleration, just make sure to stop it and save the position when v reaches 0:

Vfinal = V - f*t

So for V final = 0 you wanna stop it at t = v/f

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .