Add your own alternative version
Stats
219.8K views 4K downloads 156 bookmarked
Posted
22 Jun 2007

Comments and Discussions



I was trying to solve a similar problem but couldn't quite handle the math so I downloaded an example from the UnReal Wiki which did all the work for me. I like your solution better though.
http://wiki.beyondunreal.com/Legacy:Projectile_Aiming
I'm curious what you think of their solution.





First, could you comment your code? Thanks.
Second, I've been trying off and on to modify the intercept code for a matching intercept  ie., one in which, at the end of the intercept, the projectile is going in the same direction, with the same speed, as the target. (Once that is matched, acceleration can be matched outside of the formula and would probably be better matched outside of the formula anyway).
It would be a little too much to ask you to solve it for me, but any help you would want to give would be appreciated.
Thanks.





Hello Jay Gatsby,
First of all, i will say that you wrote a interesting article.
Unfortunately, i do not understand the vector in this line:
Targeting.Intercept(Tracking.aX, Tracking.aY, 0.0, Tracking.vX, Tracking.vY, 0.0, Tracking.pX, Tracking.pY, 0.0, this.vX, this.vY, 0.0, this.pX, this.pY, 0.0, this.aM, 0.0, 0.0, rbt, ROT, out vectors, out tui);
Is that the aiming(target) point (where the missile will go to)?
If not is there a calculation in your system, that can give me these point in level coordinates?
thx hulk





There is no aiming(target) point, as you have worded it, but there is a static Tracking class which monitors the position of the target every timestep, and, given this history, calculates what acceleration, velocity, and position the target must have to produce the last three locations it was given. I'm careful to avoid calling these computations "estimates," as in my system they are not (due to the fact that objects do in fact behave in a second derivative fashion), but if the target behaved in some unexpected manor, these would be only a best guess (as in times when the target is evading, or in scenarios where the target does not behave in a .5At^2 + Vt + P way).
In a nutshell, We're passing in what appears to be the target's acceleration, velocity, and position, along with all the other things we know. If the target behaves in a constant acceleration fashion, these will be spot on. The reason I did this was to demonstrate that the guidance system does not need the target to be faxing it's movement parameters (like it's current acceleration vector) to the missile in order for the system to function. Rather, I aimed to prove that the missile could figure out what the target is doing if the target isn't so nice as to tell it directly. This is far more realistic (and ergo, not trivial), as my algorithm does not assume that the target related information is directly known. though it is perfectly capable of mathematically solving for what it needs, as it would need to in a practical application.
Gatsby





Hallo Jay Gatsby,
thanks for replying, I work on a small space shooter game similarly yours (but with DX9).My intention was to combine your guidance system with a pathfinding system like A*. But if there is no point wich i can give the pathfinding system this does not work i together.
Hulk





After some thought, you may be able to modify it to give you what you're looking for.
you may recall this block of code from the bottom of the intercept function in Targeting.cs
for (int i = 0; i != roots.Count; i++)
{
double x;
double y;
double z;
if (pam == 0.0 && pvm == 0.0)
{
x = svx;
y = svy;
z = svz;
}
else
{
x = 0.5 * tax * roots[i] * roots[i] + tvx * roots[i] + tpx;
y = 0.5 * tay * roots[i] * roots[i] + tvy * roots[i] + tpy;
z = 0.5 * taz * roots[i] * roots[i] + tvz * roots[i] + tpz;
}
double m = Math.Sqrt((x * x + y * y + z * z));
if (m < double.Epsilon)
m = 1.0;
vectors[i, 0] = x / m;
vectors[i, 1] = y / m;
vectors[i, 2] = z / m;
}
What that's doing is finding out where the point of impact will be, and giving a unit vector in that direction (always do the else code in your case, the if is there merely to point the missile prograde when out of fuel). Note that x, y, and z are *offsets* from the shooter, so you'd have to add those back in if you want global coords. What you'd need to do is pass those offset, ununormalized raw coordinates. I threw them out in the stock intercept method because a unit vector giving direction is far more useful to someone scaling the initial launch vectors higher on the call stack. But yea, the x, y, and z as they come raw from the else block here, added to the spx, spy, and spz values respectively, should be what you're looking for, if I understood your question correctly.
Gatsby







Could you please provide some documentation as to what the arguments your expecting for the functions are? For example, the code you posted in the WW2 message:
Calculate(double Sx, double Sy, double Sh, double Sv, double Tx, double Ty, double Th, double Tv,double Pv, bool InDegrees)
I have no ideal what I'm suppose to pass for Sx, Sy, Sh ...etc.
public static double Calculate(double Sx, double Sy, double Sh, double Sv, double Tx, double Ty, double Th, double Tv, double Pv, bool InDegrees)
What I'm trying to accomplish is given two points with angle and speed, what's the equation to calculate at which point the two points will intersect. I need to make a boolean function that will calculate this and return true if they will intersect, and false if not. Then handle false by adjusting the direction in which point two travels to accommodate an interception with point one.





Good news, I can definitely help you!
I will start by identifying the intent of the parameters you have listed, but bear in mind that they are for firing on a target, not what you have explained what you need to do. Once I've done that I'll detail what you should do in your case.
Sx: the x coordinate of the shooter
Sy: the y coordinate of the shooter
Sh: the heading angle of the shooter
Sv: the speed of the shooter (along the bearing provided by Sh)
Tx, Ty, Th, and Tv are the same as the above four, but for the target, not the shooter
Pv: the speed of the projectile (we don't know it's heading, that's what we'll solve for)
InDegrees: true indicates that Sh and Th (and the returned Ph value) will be in degrees (i.e. 180), while false indicates that these values should be interpreted as radians (i.e. 3.14159...etc.).
What you need to do is pass in obj1.x for Sx, obj1.y for Sy, 0 for Sh, 0 for Sv, obj2.x for Tx, obj2.y for Ty, obj2.h for Th, obj2.v for Tv and obj1.v for Pv (and true or false for InDegrees, depending on weather you're using degrees or not for your angle measures). If an exception is thrown it means that not only will an intercept never occur, there's no way that you can adjust the heading of obj1 ot make an intercept occur. If, however, no exception is thrown, the return value you get will indicate the heading that the first object would need to have in order to intercept, and if the first object's heading is very close to this it will hit second object (i.e. the difference in heading is less than some predefined small constant, 0.000000001 being a good choice. Use AbsoluteValue(h1h2) < smallConstant for this determination, true == headings are really close, false == they're not. Do NOT use zero, rounding errors will plague youthe result will always be false!) You said that you wanted to know the heading that would be needed to intercept if no intercept would occur, well look no further, that Ph return value is what you are looking for. (Please remember to credit me with coming up with this algorithm.)
Let me know if that helps. If you are still having difficulties, please let me know, and provide what you've got so farI'll be glad to help!
Thanks for writing!
Gatsby





Thanks alot, worked like a charm , what I'm working on is a homing missle in 2D for a video game I'm trying to make. Heres what I got for the homing missle so far. Keep in mind that this is sloppy coding and my goal right now was just to get it working. My next step will be to go through and get the rest working then fine tune it. Plus, this only works for the 1st and 2nd quadrant right now. The missle will actually curve towards the target on a fixed radius until the point of intercept is true, so you get more of a realistic effect as the missle travels. This is using the TorqueX game engine and XNA.
public float Intercept(float Sx, float Sy, float Sh, float Sv, float Tx, float Ty,<br />
float Th, float Tv, float Pv, bool InDegrees)<br />
{<br />
if(InDegrees)<br />
{<br />
Sh = Sh * (float)(Math.PI / 180.0);<br />
Th = Th * (float)(Math.PI / 180.0);<br />
}<br />
float theta = (float)Math.Atan2(Tx  Sx, Ty  Sy);<br />
float shOff = Sh  theta;<br />
float thOff = Th  theta;<br />
float svxOff = (float)(Sv * Math.Sin(shOff));<br />
float svyOff = (float)(Sv * Math.Cos(shOff));<br />
float tvxOff = (float)(Tv * Math.Sin(thOff));<br />
float tvyOff = (float)(Tv * Math.Cos(thOff));<br />
float phOff = (float)Math.Asin((tvxOff  svxOff) / Pv);<br />
float crosscheck = (float)Math.Cos(phOff) * Pv;<br />
if(float.IsNaN(phOff)  tvyOff  svyOff >= crosscheck)<br />
return 1;<br />
return InDegrees ? (float)((phOff + theta) * 180.0 / Math.PI) : phOff + theta;<br />
}<br />
<br />
<br />
if((Game.Instance.Missile.Position.X + 2.5f >= Game.Instance.Enemy.Position.X) &&<br />
(Game.Instance.Missile.Position.X  2.5f <= Game.Instance.Enemy.Position.X) &&<br />
(Game.Instance.Missile.Position.Y + 2.5f >= Game.Instance.Enemy.Position.Y) &&<br />
(Game.Instance.Missile.Position.Y  2.5f <= Game.Instance.Enemy.Position.Y))<br />
{<br />
Vector2 vPos = new Vector2(0.0f, 0.0f);<br />
Game.Instance.Missile.SetPosition(vPos, false);<br />
Game.Instance.Missile.SetRotation(180.0f, false);<br />
Globals.setOrigin = true;<br />
}<br />
<br />
float fIntr = Intercept(Game.Instance.Missile.Position.X, Game.Instance.Missile.Position.Y,<br />
Game.Instance.Missile.Rotation, 0.25f, Game.Instance.Enemy.Position.X,<br />
Game.Instance.Enemy.Position.Y, Game.Instance.Enemy.Rotation, 0.1f, 0.25f, true);<br />
<br />
float angle = T2DVectorUtil.AngleFromTarget(Game.Instance.Enemy.Position,<br />
Game.Instance.Missile.Position);<br />
<br />
if((angle > 180.0f) && (angle < 275.0f))
{<br />
if((Globals.fAdjAngle > 275.0f)  (Globals.fAdjAngle < 180.0f))<br />
Globals.fAdjAngle = 275.0f;<br />
if(Globals.setOrigin)<br />
{<br />
Globals.fOrigin = Game.Instance.Missile.Position.X  15.0f;<br />
Globals.setOrigin = false;<br />
}<br />
if(fIntr > angle + 3.5f)<br />
{<br />
Vector2 vPos = new Vector2(Globals.fOrigin * (float)Math.Sin(Globals.DegreesToRadians(Globals.fAdjAngle)),<br />
Globals.fOrigin * (float)Math.Cos(Globals.DegreesToRadians(Globals.fAdjAngle)));<br />
Game.Instance.Missile.SetPosition(vPos, false);<br />
Game.Instance.Missile.SetRotation(angle + 180.0f, false);<br />
}<br />
else<br />
{<br />
Vector2 vPos = new Vector2(Game.Instance.Missile.Position.X + (0.25f * (float)Math.Sin(Globals.DegreesToRadians(Game.Instance.Missile.Rotation))),<br />
Game.Instance.Missile.Position.Y  (0.25f * (float)Math.Cos(Globals.DegreesToRadians(Game.Instance.Missile.Rotation))));<br />
Game.Instance.Missile.SetPosition(vPos, false);<br />
Game.Instance.Missile.SetRotation(angle + 180.0f, false);<br />
}<br />
<br />
Globals.fAdjAngle = 0.25f;<br />
}<br />
else if((angle > 90.0f) && (angle < 180.0f))
{<br />
if((Globals.fAdjAngle > 180.0f)  (Globals.fAdjAngle < 90.0f))<br />
Globals.fAdjAngle = 90.0f;<br />
if(Globals.setOrigin)<br />
{<br />
Globals.fOrigin = Game.Instance.Missile.Position.X + 15.0f;<br />
Globals.setOrigin = false;<br />
}<br />
if(fIntr > 0)<br />
{<br />
Vector2 vPos = new Vector2(Globals.fOrigin * (float)Math.Sin(Globals.DegreesToRadians(Globals.fAdjAngle)),<br />
Globals.fOrigin * (float)Math.Cos(Globals.DegreesToRadians(Globals.fAdjAngle)));<br />
Game.Instance.Missile.SetPosition(vPos, false);<br />
Game.Instance.Missile.SetRotation(angle + 180.0f, false);<br />
}<br />
else<br />
{<br />
Vector2 vPos = new Vector2(Game.Instance.Missile.Position.X + (0.25f * (float)Math.Sin(Globals.DegreesToRadians(Game.Instance.Missile.Rotation))),<br />
Game.Instance.Missile.Position.Y  (0.25f * (float)Math.Cos(Globals.DegreesToRadians(Game.Instance.Missile.Rotation))));<br />
Game.Instance.Missile.SetPosition(vPos, false);<br />
Game.Instance.Missile.SetRotation(angle + 180.0f, false);<br />
}<br />
<br />
Globals.fAdjAngle += 0.25f;<br />
}code><br />
<br />
<br />
 modified at 20:02 Monday 27th August, 2007





YES! *does a victory dance* I helped somebody! Glad to know it worked for you!
<whisper>You wouldn't mind putting "//Intercept algorithm developed by Christopher Kampas, © 2007, all rights reserved" above "public float Intercept(float Sx, float Sy, float Sh, float Sv, float Tx, float Ty, float Th, float Tv, float Pv, bool InDegrees)" would you? *blush* It would be an honor to "see my name in lights," so to speak... you know what I mean?</whisper>
Gatsby





Lol, I can do that, thanks again!





I appreciate it, and thank you!
Over and out.
Gatsby





Jay,
You are missing a point here. Especially, if you ignore impossible cases.
Try solving the missile 'torpedo' problem (in two dimensions) for all possible vessel and weapon speeds using quadratitics or trig. It won't work.
There is a far simpler logical solution, that was sorted out in WWII to produce the mechanical torpedo aiming calculator known as the 'fuit machine'.
No 1GHz processors in those days.
Roland





First of all, thank you for your interest and the time you gave to comment.
Ivertheengine wrote: Try solving the missile 'torpedo' problem (in two dimensions) for all possible vessel and weapon speeds using quadratitics or trig. It won't work.
Really? I seemed to have figured out that one a while back. (these acronyms are referring to x position, y position, heading, and velocity (along that provided heading), where we want to solve for the projectile's heading, given everything else about this problem) Here's my original code, it's actually my very first analytical solution for this problem that I came up with:
public static class InterceptCourse
{
public static double Calculate(double Sx, double Sy, double Sh, double Sv, double Tx, double Ty, double Th, double Tv,
double Pv, bool InDegrees)
{
if (InDegrees)
{
Sh = Sh * Math.PI / 180.0;
Th = Th * Math.PI / 180.0;
}
double theta = Math.Atan2(Tx  Sx, Ty  Sy);
double shOff = Sh  theta;
double thOff = Th  theta;
double svxOff = Sv * Math.Sin(shOff);
double svyOff = Sv * Math.Cos(shOff);
double tvxOff = Tv * Math.Sin(thOff);
double tvyOff = Tv * Math.Cos(thOff);
double phOff = Math.Asin((tvxOff  svxOff) / Pv);
double crosscheck = Math.Cos(phOff) * Pv;
if (double.IsNaN(phOff)  tvyOff  svyOff >= crosscheck)
throw new UnableToInterceptException();
return InDegrees ? (phOff + theta) * 180.0 / Math.PI : phOff + theta;
}
}
public class UnableToInterceptException : Exception
{
public UnableToInterceptException() : base("Unable To Intercept") { }
}
Ivertheengine wrote: There is a far simpler logical solution, that was sorted out in WWII to produce the mechanical torpedo aiming calculator known as the 'fuit machine'.
I'm still looking at this, but, just to make sure we're on the same page, did you mean "fruit machine?" The Google query "fuit machine" torpedo yields a dead end, while "fruit machine" torpedo yields some really promising references, like this[^] for example.
Gatsby







Did you win the comp with this, or did the color one slip in there.
Either way, great job.."I shall be watching your future most carefully" (starwars quote, but the guy he was referring to turned out to be the badest dude (Darth Vader) in the galaxy, so perhaps not quite such an honour. mmmmm)
Sacha Barber
A Modern Geek  I cook, I clean, I drink, I Program. Modern or what?
My Blog : sachabarber.net





It seems I lost by three votes, meh, It was fun while it lasted anyway.
That's what the poll says anyway (http://www.codeproject.com/script/survey/detail.asp?survey=695[^]), it doesn't seem that they've made it official yet(http://www.codeproject.com/script/competitions/monthly/[^] still lists May winners at the bottom), but that'll come any time soon. I'm O.K. with it at any rate, nice to know I got selected for the "editor's choice" on the homepage, even if the byline is blankWho cares at that point anyway?
I'm still humored that I got more votes in the monthly competition than I have received for this article directly...
I'm nothing but encouraged! I never thought I could write an article that could go anywhereblood is in the water now! I can't wait to do this again!
Gatsby





You did great. I voted for you at any rate.
Jay Gatsby wrote: I'm nothing but encouraged! I never thought I could write an article that could go anywhereblood is in the water now! I can't wait to do this again!
Yeah that happens. It happened to me, I have been a CP member 3 1/2 year, but only started to write articles about 9 months ago, and now look im addicted.
I think we both have many more good ones to come
Sacha Barber
A Modern Geek  I cook, I clean, I drink, I Program. Modern or what?
My Blog : sachabarber.net





You took the honored path for learning this craft: take a problem that keeps pestering you, spend a lot of time thinking with a pen and paper interface, then spend a lot of time programming. Yes, the code could be cleaner, and the comments more focused. Don't worry, that'll come. What's already there is the ability to stay focused and get the results. After 25 yrs on programming you learn to recognize the signs: you'll do great!





Jay,
This article is very very interesting.
I salute you sir.
Sacha Barber
A Modern Geek  I cook, I clean, I drink, I Program. Modern or what?
My Blog : sachabarber.net





Sacha! good to hear from you again.
Wow... It's an honor that you like it, thank you! Good luck on the monthly competition! your entry is outstanding!
you salute me? I'm honored, but it should be the other way around! (salutes Sacha)
Gatsby





Jay,
To be honest I think my entry this month, is fairly tame. However, the one im writing at the moment is very cool. taking a very long time to do, but its good I hope.
I love your article, its very very impressive for your 1st one. Hopefully plenty more to come from you.
Keep it up
Sacha Barber
A Modern Geek  I cook, I clean, I drink, I Program. Modern or what?
My Blog : sachabarber.net





Well I can't wait to read your next one!
Thanks.
Gatsby





The new one is WPF also, but i am also using WCF, as I am interested in seeing how all this new stuff works together.
Ive tried Winforms / LINQ, and also WPF/ XLINQ, So I thought Id try WPF/WCF combo.
Its nearly done. It takes me longer these days, as I work full time now. Where as before I had loads of spare time, as I was doing an MSc.
Sacha Barber
A Modern Geek  I cook, I clean, I drink, I Program. Modern or what?
My Blog : sachabarber.net





Hi,
I am sorry I didn't read the whole article.. I will read this later, but from the information gathered by reading couple of paragraph and also looking at the animation it seems that your concept is wrong, you expect the target to move in the predicted path, you shoot the missile in a way so that it meet the target if it move in the predicted path. In real world case the moving target always change it's direction, target will definitely change it’s direction after you shoot the missile, in that case your system will fail, isn’t that so.. in order to solve the issue you have to dynamically adjust the missile direction regularly to increase the accuracy.
The latest missile guidance systems do dynamically adjust their direction according to the moving direction and speed of it's target..
Let me see your thoughts..
L.W.C. Nirosh.
Colombo,
Sri Lanka.





well yes, of course you have to adjust for evasion. That's what the checkbox in the Simple UI download demonstrates. the concept is not wrong at all: if you don't evade I should be able to hit you in a straight line, this means that if you do evade there is a new straight line I should follow, and I adjust my flightpath to account for this new vector, if no evasion occurs, I will continue to fly in a straight line towards the intercept. The way it works is the missile "intercepts" the target at EVERY timestep (when onboard guidance is enabled, of course). By performing the calculation each timestep, the instant the target changes it's motion the missile reacts to it and then proceeds on that straight line until interception or until it needs to change again to account for evasion (in which case it rides that line until impact, unless another evasion occurs... etc.). The real trick is calculating those straight lines, and that is what my guidance system does.
Play around with the Simple UI with onboard guidance turned on (put a check in the box to activate it) to improve understanding. Note that when things wrap around the screen it messes with the guidance system, because it's tracking using three points in space that the target is at relative to it and isn't anticipating a warping movement like wrapping around, but You'll get the picture when you see what goes on. you move, the missile makes one turn and then keeps on coming in a straight line (unless you move again, then it makes another small course correction and heads in a straight line etc.).
The graphs etc' are for the calculation of these straight lines. The line will not necessarily play out this way (evasion etc.) but it is the fastest way to the target, and as such, if they want to evade, they will have to work the hardest to get out of the way if the missile attempts to lead the target in this manner.
Thanks for inquiring.
Gatsby





I am sorry for not checking the demo before commenting..
If you do consider the direction and also the *relative* *speed* for these calculations.. this should be a complete one..
L.W.C. Nirosh.
Colombo,
Sri Lanka.





Actually, that's step one of the algorithm. the shooter's paramerters are nullified to produce the scenario in terms of relitive position and relitive velocity.
Thanks for writing
Gatsby





Gatsby, you should consider some limitations when changing trajectory and / or speed of your missile while is moving in "guided" mode. You can never hit a target in straight line if it has no constant speed and direction, or its speed / acceleration is greater than you missile. What I'm trying to say is that your missile can't fly like a fly (the insect) or a mosquito... in zigzag.





I must admit I'm a little confused by this, but I do love taking suggestions.
If you were talking about constraints on maneuverability... those are already present, are you suggesting that the limitations be even greater? if so, you can just adjust a constant in my application's source for this effect... I think I called it MAXDELTATHETA or something.
If you were talking about zigzagging as a result of evasion, this is actually the optimum response, because while the missile is wasting energy by repeatedly performing this elaborate twostep, bear in mind that the target is losing just as much by jinking around to invoke such highG maneuvers. It takes two to tango. The moment the target consolidates and proceeds by accelerating straight, the missile's maneuvering will have it right on course, and advantaged by the target's evasioninduced slowdown, but if the target never consolidates and chooses to push it's evasion all the way to the wall the missile will likely make a glancing blow because it cannot maneuver fast enough when it gets really close to the target to put it right down the middle, but the target will have so little energy by now that it might as well be standing stillAt any rate, energy is the key to success; as the relative speed between the missile and the target increases, the effectiveness of an evasive action increases, and as the distance between missile and target decreases the same is true, but only up to a pointit's bad news if evasion is too late because there simply isn't enough time to get clear of the missile as it flies past.
...But I think I may have missed what you were getting at altogether...
Gatsby






Very nice reply... very informative, experienced and certainly well documented. Thank you!
I'd like to see an article on this subject written like this.
I'm not so well informed on the advanced military technology... and your reply was correct to contradict; my point was different, though: do you see anything in the above article about the mass / centrifuge force of both target and missile, so how is the "zigzag" motion handled? How about other more complicated corrections that need to be applied when handling motion? No matter how advanced technology might become, it will remain bound to phisycs rules. The math (modelling) presented here is far from any realtime / reallife example. But hey, as I've struggled for long already to make everyone understand... it's a great start, and I'm merely trying to motivate the author to go further in detail... who knows, maybe even "patent" something... making a great future in research; I think he might like it, 'cause it's one hell of an interesting life.
Best regards,





Recall that the same rules that apply to the warplane attempting to 'seduce' the incoming missile  the laws of physics aren't 'particular' about who or what they apply to. WHat you do to one side of the equation must be done to the other. In this case, the absence is balanced.
And I'd venture to say that the absence of newtonian and other physical equations dealing with force vectoring (weight, drag, lift, densityaltitude, gyroscopic drift, counterangular and countercentrifugal mathematic calculations fed against consequential and intended flight pathing adjustments) is likely the result that the young gentleman doesn't have access to a lab where these things can be modeled more effectively.
Afterall, it took the resources of the US Government and the best brains in the engineering business fifty years to produce the kind of weapons and weapon technology employed today. A visit to a few web sites will give you the rather interesting history of the AIM9 air to air missile  which was first run by vacuum tubes fed by a spinning cassagrain mirror back in the 1950's. It was able to make small adjustments in the flight path and strike a moving target. As you might appreciate, the missile's 'brain' was strictly analog  the seeker caused the rocket to constantly oscillate in its flight path.
The gap in generations and deployment of further developments in the AIM9 family basically follow the halfcentury long march toward the kind of weapon platform I described earlier; one that can so rapidly calculate the movement of the target and analyze the consequential flight path, that no matter what amount of jinking and evasion technique employed, the missile's Pk (probability of Kill) will be so high that the pilot might as well eject before he lifts off.
The young man who wrote this code and figured out the foundational aspects of the missile tracking problem just graduated high school. I too want to encourage him to keep pushing, explore the boundaries and break through them. Let's not burden him with attempting to be perfect  rather, let's celebrate that he's on our side.;P
The madman is not the man who has lost his reason; the madman is the man who has lost everything except his reason.
G.K. Chesterton





Redgum wrote: let's celebrate that he's on our side.
And rather proud of it.
Jeez you know alot!
A word on the unincluded factors, if I may: I have come to the conclusion that the missile can lead a target with the understanding of any number of external forces beyond plain old constant acceleration that behave in any way imaginable (logarithmic for air resistance, trigonometric for orbits, etc., rather than the pure polynomial stuff I've been using), with a massive rewrite of the equations; however, I have come to the conclusion (and can prove, if need be) that my underlying approach to the problem will work in any environment in which time ticks by at a constant rate (please don't make me drag in general relativity... it seems trivial to do so on things not even remotely close to the speed of light). The underlying truth is the Tt = Pt conclusion. That is to say that, once I have negated the shooter's influence on the problem, the missile can hit the target if/when the missile's distance from the origin is the same as the target's distance from the origin (the origin, again, is the missile's launch point with the shooter parameters negated, and therefore subsequently subtracted from the target), if and only if the missile's behavior relative to the origin is the same no matter which way I point it. But that's still quite an obstacle.
My current research is in the area of these socalled "dynamic" trajectories, i.e. situations where the output of the Pt equation depends on the direction the missile is fired. The problem here is that I can no longer calculate how long it will take without knowing which way I am going to need to aim, instead of vice versa, as I do now.
Anyway, your comments got me thinking on the matter, expect a sequel someday in the semidistant future.
Gatsby





>Anyway, your comments got me thinking on the matter, expect a sequel someday in the semidistant future.
I'm looking forward to it. Just be mindful  as crazy as it might at first seem  that such algorithms and programmatic representations of them can be classified as 'munitions' and subject to strict exportation laws.
Don't be surprised if you get a personal visit requesting that you cease and desist by a nice man in a suit with a National Security Agency credential after posting the sequel. The good news is that the guy who visits after him will likely have a quaint little job offer.
In the meantime, there are some challenges ahead of you. Keep up the good work!
Mike
p.s. And if you'd like someone to betatest, I'm usually available
The madman is not the man who has lost his reason; the madman is the man who has lost everything except his reason.
G.K. Chesterton





Thank you for your kind words and your informative reply, I will bear all of this in mind.
Redgum wrote: And if you'd like someone to betatest, I'm usually available
You're really too kind; I might just take you up on that when I get my next version to that stage, as it will doubtlessly be much more complicated.
Gatsby





Hi,
i´m not a good programmer, but as i took classes of econometrics, to dynamicaly adjust equations before we get new values for the parameters we use the Kalman Filter... i really don´t know if this will work, but is a good try when you need to make adjusts.
Fernando Pavani





Hey, Jay. I can't seem to use email (private message) facility in this website. It keeps submitting the form result to an unfound page and giving me 'Page not found' error message. How can I contact you privately to discuss something about the article's concept? Thanks!





Contact me via ckampas as seanet dot com
Gatsby





You mean as = at, right?
Anyway, mail sent. Thanks.





Moohoohaaahaahaaaaa! Soon the world will bow before their new leader and tremble under my mighty missile defense/offense system! Take that guidance councilor!
Moohoohaaahaaaa!
Thanks,
Ben






Hi Jay,
Would you mind me asking why you decided to go to DigiPen instead of one of the more prestigious schools that you undoubtedly could have attended?
Phil





In short, I'm not rich. Also, I like game development, and they specialize there. Additionally, it's 30 min from where I life, and with moving being all but out of the question... I also wasn't exactly a 4.0, because of Asperger's, ADD, and my own personal problems with the system I shouldn't have let get to me, so I'm not going to be accepted by some MITlike school. It seemed to fit pretty well actually. I honestly thought I wouldn't get into DigiPen to tell you the truth.
Gatsby





Years ago, when I left the US Navy, I wrote a 'fun' little program that simulated a MK48 torpedo's behavior in the water after being launched by a sub. It was a barrel of laughs to watch the blue dot on the Commodore64's screen homein on the evading enemy sub. Took months for me to get the simulation just right  tranfered the logic to a computertocomputer game we called "Modem Warz"  a simple 2D screenscrolling map in which two players battled over a modem connection. An upgrade to the missiles used the logic I wrote for the MK48 simulator. But it was nothing like this.
My hat's off to you. The missile flight problem has been in the back of my mind as something fun to program at some point  in a game spawned in its own thread, this would be a joy to watch in operation.
What's amazing to me, is that you've just graduated high school and you've accomplished this already. Impressive, enjoyable, and very refershing. Great job!
Now, I have a simulator for you to accurately model  a true ballistic simulation with simultaneous multiple wind vector & velocity adjustments.
The madman is not the man who has lost his reason; the madman is the man who has lost everything except his reason.
G.K. Chesterton





Redgum wrote: What's amazing to me, is that you've just graduated high school and you've accomplished this already. Impressive, enjoyable, and very refershing. Great job!
Thank you for your kind words.
I too had the missile flight problem in the back of my mind for some time, but people who know me will tell you that things don't stay in the back of my mind for longthis problem was aggravating me and I had to solve it, as fast as possible (uh, yea, that would be something like 8 months )
If you were surprised that I just graduated from high school and have already produced this, I would like to point out that I should have been able to solve it quicker, considering the simplicity of the result (even if at first glance the algebra does not look intuitive, that's no excuse).
Heh, if I may share an anecdote (it amused me at least), in math class my neighbors always saw me scrawling out huge polynomials that, with my shaky handwriting, typically ran halfway down the page before I simplified them and combined like terms, using a compass to draw a circle on a parametric graph of a parabola floating in some orientation out in the middle of the paper, or simply closing my eyes or staring of into space for a halfhour some days while they worked on their worksheets about the law of cosines or the properties of parallel lines (I went through a one subject notebook of scratch paper per semester). I laugh a little when I think of the times that my peers quibbled about how hard the math homework was and sometimes would ask for all of the answers, whereupon I would smile and pass them a piece of my missile guidance system scratch paper with the Albert Einstein quote “Do not worry about your troubles in mathematics. I can assure you mine are still greater” written diagonally across the unused space in one of my graphs. They were able to read some of it in fact, and they decided to stop asking me for the trivial answers, thank God.
Gatsby





I like your article  so you got my 5...
I found a problem in the SimpleGuidanceSystemUI.sln.You should fix the project path  it points to a wrong location.







General News Suggestion Question Bug Answer Joke Praise Rant Admin Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

