Vector prediction

Started by
25 comments, last by a1studmuffin 21 years, 11 months ago

ok i think i outlined a solution but i will need to test it cause its out there. no interations.

the idea is draw a line from the ship to the target call it R. now draw the targets velocity vector. mark the angle between the velocity vector "a".

now draw the missle vector as yet unknown but intercepts the target vector at some point. mark the angle between the missle vector and the R vector "b"

    now note that sin "a"                  sin "b"-----           =       ----------misslespeed              targetspeed    

thats according to the law of sines. all known cept for sin "b"

easy enough to solve for. then once you have it you do the rotation and your done. noting this all happens in a plane regardless of where its at in space.

but the math will be messy and i want to test it myself.

edit: got the files now they are fine. bad download.


[edited by - declspec on May 7, 2002 7:29:53 AM]
Advertisement
I never said that parametric solutions wouldn''t work, you implied that in your post.

Also, did you read my first post? I said that you don''t know your firing direction. You said we do know it? I thought that''s what we''re trying to solve here? At the very least the time it takes..

I''d love to see a derivation of a trivial solution.

Actually, not quite declspec... since you drew a line between the ship and the object, that side of the triangle represents a distance... and the other two represent speeds... you need to scale the other two lengths by the time interval it takes the object to move from its position at t0 to its point of collision at time tc, if you want to apply the law of sines. Call this interval dt = tc-t0.

Then

sin(a)       sin(b)------   =   ------ VBdt        VAdt  


Thankfully the dt's drop out and you get the same result... that
                VAsin(b) = sin(a)---                VB  


This is the two line derivation I alluded to in my last post.

The time of intersection can be obtained by solving the law of cosines on the same triangle... giving
tc = t0 + P +/- sqrt(P2-|R|2)

where

    VB|R|cos(b)P = ------------    VB2 - VA2  


and |R| is the length of the line R, between the ship and the object at t=t0.

Take the +ve solution for tc.

Now, in 3D, the problem is just as simple, since the lines VA dt, VB dt and R form a plane. Hence the bearing b is still valid as an angle of rotation in that plane.

At the time of collision, the asteroid will have a z coordinate given by

z(tc) = z(t0) + (VA .k )(tc - t0)


You can now either determine the x and y coordinates of the point of intersection in exactly the same way (substituting obviously the i and j basis vectors for k respectively) or you can determine the angle of elevation (gamma) of the target point, relative to the ship, from...

             z(tc) - z(t0)sin(gamma) = -------------                VBdt  


Hope this helps,

Cheers,

Timkin

[edited by - Timkin on May 7, 2002 9:59:10 PM]
quote:Original post by declspec
you have to picture being at the bottom of dm1 from q2 and shooting at someone that just jumped from the top. real life people know to shoot somewhere near the bottom.


Of course in real life, you aim directly at the falling object, because your bullet will fall the correct distance due to gravity that the target is falling and thus hit the target as planned!

Cheers,

Timkin
quote:Original post by _SHO_NUFF
I never said that parametric solutions wouldn''t work, you implied that in your post.



You said that substitution wouldn''t work. As to me implying it wouldn''t work, where on Earth did you get that idea? Could you find the line please and quote it so I can see what you''re talking about?

As to the issue of knowing the bearing, I already apologised for my misinterpretation of what you were saying. If you want to belabour the point go ahead... but I don''t see anything positive coming from it... and I wont join in.

Timkin
auum tim i realize that =).

im not flaming just think about your words. how does a clearly true and provable statement get a "not quite"? you lead of with "declspec not quite" then went on to comfirm my post. *nod*. is my statement true. its true. ty for the comfirmation.
"thankfully... you get the same result" is amusing.


we all have different tolerances for obvious. people learn quickly to give me lots of leash on obvious.





quote:Original post by declspec
im not flaming just think about your words. how does a clearly true and provable statement get a "not quite"?


Because you were comparing apples and oranges.

To apply the Law of sines, you must do so on a triangle. You didn't apply the Law of sines to a triangle, but rather to some speeds. One side of your 'triangle' was a length and two sides were speeds, so, if I were to apply say the law of cosines to your 'triangle' to verify your angle, I would get a different value. Strictly speaking, the Law of sines is

sin(a)    sin(b)    sin(c)-----  =  -----  =  -----  A         B         C 


so if you were to check this on your 'triangle', you wouldn't get 3 equal quantities

Had the sides of the triangle ALL been speeds, that would have been fine... and as I pointed out, the result turns out to be the same, since the side lengths are scaled speeds and you were lucky that they cancelled out in the ratio when comparing two of the quantities from the Law of sines.

Mathematically speaking your were incorrect... but I did point out that you obtained the correct result... and why.

Cheers,

Timkin

[edited by - Timkin on May 8, 2002 11:03:52 PM]

This topic is closed to new replies.

Advertisement