http://pastebin.com/YigPX1A3
So something is wrong with gravity the X Y is fine but Z is a pain.
usage place a radar on top of a computer ant run this program. If you have problems with power low error then run the radar from batteries not directly from generators.
any help would be useful.
Thanks in advance
[ICBM] missile parth prediction Math probblem ?
Started by BigSHinyToys, Nov 07 2012 12:30 AM
6 replies to this topic
#1
Posted 07 November 2012 - 12:30 AM
#2
Posted 07 November 2012 - 01:36 AM
You have very few comments in your code, so it takes me a while to figure out what you're doing.
/> If you're thinking about actually predicting the trajectory.. I decompiled ICBM last week to look into that. The code was mostly in Japanese >.< but I came to the conclusion that the 'parabola' isn't physically correct. I also read a post from the author once, kinda saying the same thing. Also, wouldn't you need velocity and starting angle to calculate the trajectory as well?
#3
Posted 07 November 2012 - 04:48 AM
Orwell, on 07 November 2012 - 01:36 AM, said:
You have very few comments in your code, so it takes me a while to figure out what you're doing.
/> If you're thinking about actually predicting the trajectory.. I decompiled ICBM last week to look into that. The code was mostly in Japanese >.< but I came to the conclusion that the 'parabola' isn't physically correct. I also read a post from the author once, kinda saying the same thing. Also, wouldn't you need velocity and starting angle to calculate the trajectory as well?
how is java Japanese o.O
#4
Posted 07 November 2012 - 07:21 AM
Kolpa, on 07 November 2012 - 04:48 AM, said:
Orwell, on 07 November 2012 - 01:36 AM, said:
You have very few comments in your code, so it takes me a while to figure out what you're doing.
/> If you're thinking about actually predicting the trajectory.. I decompiled ICBM last week to look into that. The code was mostly in Japanese >.< but I came to the conclusion that the 'parabola' isn't physically correct. I also read a post from the author once, kinda saying the same thing. Also, wouldn't you need velocity and starting angle to calculate the trajectory as well?
how is java Japanese o.O
#5
Posted 07 November 2012 - 07:38 AM
Just use a constant X and Y velocity, and for Z, you will do something like this:
g is in this case 9.8
Then, to find the rotation of the object, you would do this:
To apply all of this to the current game state, do this:
g is in this case 9.8
velZ = velZ + g * 0.16 -- 0.16 is equal to about 60 FPS
Then, to find the rotation of the object, you would do this:
local _x = lastX - x local _y = lastY - y local len = math.sqrt(_x ^ 2 + _y ^ 2) rotation = math.acos(_x / len) if y < lastY then rotation = 2 * math.pi - rotation end radians = 2 * pi - rotation rotation = math.deg(radians) -- get rotation in degrees lastX, lastY = x, yYou would apply this to x/z as well, and so on...
To apply all of this to the current game state, do this:
x = x + velX y = y + velY z = z + velZ
#6
Posted 07 November 2012 - 08:31 AM
The author of ICBM deliberately uses words in a language other than English in order to confuse people decompiling it - as he had been bitten by people stealing code before.
#7
Posted 07 November 2012 - 11:05 AM
I did some testing on the flight path the rate of change over time on the X and Y is a constant so i gain that by averaging the difference between data points in the set. my problem is following the curve current accuracy is about 400 meters.data recorded from a real ICBM launch using Computer craft.

data set
http://pastebin.com/Wkc9mcJR

data set
Spoiler
as for code commenting sorry I'm used to working on my own and have a near photographic memory here is commented ver.http://pastebin.com/Wkc9mcJR
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











