Thursday, April 7, 2011

Math, a new plane to work on

Idea given to me by my Math friend Adam
So, as I think I mentioned, I was discussing how to do this with a friend. But until tonight I didn't have too much time to reflect on what he was telling me. He said, not exactly:  use the angle of elevation to make a connecting line between the target and the turret, then use that and the plane of the z axis to create a new axis. Since this is now a 2d problem solve it with newtons laws of motions that take gravity into effect. And kerpow.

Ok he didn't say kerpow. but I'd like to imagine that's what his brain said when it thought all of that up. He's basically a math genius. Anyway though, what I'm now encountering as a difficulty, is how to switch from my ox,oy axes to my original coordinate system. ox corresponds to the line connecting them, so it must be the magnitude of the position vector. As far as converting the y axis of my new axis back, I'm not entirely sure. Although, I have a feeling that the converstion isn't neccesary for going back, only to converting the targets coordinates into the new system. But after that, the angle of elevation + the new angle given to me by my equations should give me the 'real angle' to fire on. And that will give me my velocity vector's z component. (it's x and y are calculated by the angle the turret faces on the XY plane. Anyway, I believe, that the y component of my target will be 0 in the ox,oy axes. Because the line connects both turret and target. And if you look at the drawing above, it's abundantly clear.

now that the details are, once again, possibly worked out. Time to code!

No comments:

Post a Comment