How to write an acceleration equation in thyme?
3 posts • Page 1 of 1
How to write an acceleration equation in thyme?
Is there any possible way to write a code to determine the acceleration of an object ( both horizontal acceleration and vertical acceleration separately ) ?
waiting for semester break to come...
-
faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: How to write an acceleration equation in thyme?
Thats totally simple tho and should be asked in the thyme subforum. Just declare a variable _prevVel = vel (using the black mini console of your object), and then calculate the accelleration using poststep:
accell = (vel-_prevVel)/e.dt;
_prevVel = vel;
The entire accelleration would be math.vec.len(accell) while the components would be accell(0) and accell(1)
accell = (vel-_prevVel)/e.dt;
_prevVel = vel;
The entire accelleration would be math.vec.len(accell) while the components would be accell(0) and accell(1)
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
Re: How to write an acceleration equation in thyme?
FRA32 wrote:Thats totally simple tho and should be asked in the thyme subforum. Just declare a variable _prevVel = vel (using the black mini console of your object), and then calculate the accelleration using poststep:
accell = (vel-_prevVel)/e.dt;
_prevVel = vel;
The entire accelleration would be math.vec.len(accell) while the components would be accell(0) and accell(1)
Thanks a lot, your method is much simpler and effective comparing to other methods
waiting for semester break to come...
-
faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests