|
-
Mar 16th, 2010, 04:39 AM
#1
Re: Cannons
For 4D, suppose gravity pulls downwards in the z direction. That is, gravity accelerates objects in such a way that their z coordinate eventually goes to negative infinity. Also suppose that the target moves along a parametrized, continuous, invertible curve on a finite interval. More concretely, this means that we can (somehow) compute the target's position given an input time, that this position is unique--each time corresponds to one position and vice-versa--and that if time is moved ahead only slightly, the position changes only slightly.
In general it is possible to invert such a curve to an arbitrarily high degree of accuracy. However, this is somewhat immaterial to my purposes (though I can make up an algorithm if anyone is interested). Say that f(t) = (x(t), y(t), z(t)) gives the position of the target given some time t, and that g(x, y, z) = t inverts this process.
Now, allow the cannon to rotate in three dimensions instead of two. This situation, it turns out, is much easier to describe using unit vectors instead of angles. So, suppose the cannon points in some direction v=(vx, vy, vz) where v gives the initial velocity of a projectile fired from the cannon. Say that the magnitude of this velocity has been already chosen, presumably because the cannon wants to fire with as much force as it can muster. However, we can rotate v in any direction we wish.
Suppose the cannon knows the target's position function f(t). It is then possible for the cannon to compute g(x, y, z), that is, the time at which the target reaches position (x, y, z). The cannon wishes to hit the target when the target is at position (xc, yc, zc). We can compute the time of collision using g(xc, yc, zc) = tc. When should the cannon fire to accomplish this? Since the direction of initial velocity may be varied, there are in general an infinite number of acceptable firing times/velocity pairs. So, let's restrict ourselves to one particular firing time, called tf. Clearly tf <= tc, i.e. the cannon fires before the cannonball collides with the target. Now the problem is tractable: how should the cannon be rotated to hit the target?
I'll post a solution sometime later. As a brief outline, the trick is to consider the plane which contains the +z unit vector and the vector connecting the cannon and the target at the point of collision. The variables in this incarnation may then be mapped directly onto the variables in the original post, and a solution may be obtained.
I thought about doing a more complicated version of this problem, but the other versions I came up with were all almost intractably difficult analytically. I believe generic non-linear multivariable constrained differential equation solving algorithms would be able to solve the problem in a more general setting, but... that's complicated.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|