I'm working on some physics for a rocket projectile. The rocket can launch and move appropriately, however, I am having trouble getting the required trigonometry for direction. I am currently getting the difference between the last x/y and the new x/y, and then using the atan function with division, but the angle gets messed up when the slopes change.
Offline
Offline
Offline
Perhaps this project by Paddle2See might help?

Offline
Yeah, but I'm trying to do the physics, not just random trig.
Offline
I see two problems: (1) t does not change at the same rate as x, so you're stretching the function vertically; (2) you should use the atan2 function to map x, y -> θ, rather than just the atan function.
Offline
How do you implement atan2 in Scratch?
Offline
bobbybee wrote:
How do you implement atan2 in Scratch?
Offline
You want the rocket to point towards the next xy location?
You might want to look at a script I made which does that.
http://scratch.mit.edu/projects/what-the/1178312
It should be possible to make the script even smaller.
Last edited by what-the (2012-02-20 20:13:45)
My site Offline