Sign in to follow this  
BeanDog

Integral combining polar and euclidean coordinates?

Recommended Posts

BeanDog    1065
Here was my problem. It's a little complicated. I wanted to symbolically integrate to get a formula to determine the position of my object after time t. For instance, in pure euclidean coordinates, xt = x0 + v0xt + .5axt2 and similarly for y. The problem is that my acceleration is changing with each frame, because I essentially have introduced polar coordinates into the system. My object has a Θ which represents the angle it is facing, and a vΘ that represents the speed at which theta changes. Thus Θt = Θ0 + vΘt So now, the above formula for xt is no longer valid. It is now much more complicated. Now, a is a scalar representing the magnitude of the acceleration in direction Θ, and v is a scalar representing the magnitude of the velocity in direction Θ. In an effort to get to the source of the issue, I determined that dx/dt = vtcosΘt meaning that X changes at a rate of vtcosΘt at time t, where vt is the scalar speed at time t and Θt is the angle at time t. So in order to find x, I have to integrate the dx/dt above. Before getting there, though, I have to find formulas for vt and cosΘt in terms of t. So I determined that vt = v0 + at That was simple enough. I also know that Θt = Θ0 + vΘt Also simple enough. That means that, plugging in, dx/dt = (v0 + at)cos(Θ0 + vΘt) Thus, integrating, xt = (v0sin(tvΘ + Θ0))/vΘ + a*cos(tvΘ + Θ0))/vΘ2 + at*sin(tvΘ + Θ0))/vΘ + x0 And, similarly, for y: yt = -(v0cos(tvΘ + Θ0))/vΘ + a*sin(tvΘ + Θ0))/vΘ2 - at*cos(tvΘ + Θ0))/vΘ + y0 Under simple simulation, this appears to work wonderfully. This post was going to be a question, but I got it all figured out. I'm posting my results here for the benefit of the community. The motivation for this exercise was dead reckoning for objects whose motion is defined by a scalar speed, direction, direction change speed, and acceleration; and vector position. Please post any comments or suggestions. I realize, of course, that computationally my formulas are not minimized, but they're written in a simple form for readability's sake. Actual implementations should optimize the computation (e.g. by precalculating tvΘ + Θ0). ~BenDilts( void );

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this