Finding trajectory equation from a scatterplot

toast

New member
Joined
Jan 15, 2021
Messages
4
Hello all,

Let’s say I shoot a gun at, say, 20degrees angle of elevation, and it lands, say, 1000 meters away. I want to find the equation where if I input a range value into an equation I can solve for the angle of elevation value. I can do this by plotting a scatterplot where the x value is the degree and y is the range, yes? However, suppose I am on a hill and there is a target I want to hit 1000 meters away in a valley. If I fire at 20 degrees, I would overshoot the target because my elevation is higher than my target. How would I account for elevation in my equation, so that if I input a value for range and a value for elevation, I will receive a degree value, allowing me to hit the target even when I am on a separate elevation from the target?
 
Hello all,

Let’s say I shoot a gun at, say, 20degrees angle of elevation, and it lands, say, 1000 meters away. I want to find the equation where if I input a range value into an equation I can solve for the angle of elevation value. I can do this by plotting a scatterplot where the x value is the degree and y is the range, yes? However, suppose I am on a hill and there is a target I want to hit 1000 meters away in a valley. If I fire at 20 degrees, I would overshoot the target because my elevation is higher than my target. How would I account for elevation in my equation, so that if I input a value for range and a value for elevation, I will receive a degree value, allowing me to hit the target even when I am on a separate elevation from the target?
Sounds like you want to design a game!

Please draw sketch depicting exactly what is given (what you know about the situation) and what you want to find (calculate).
 
Hello all,

Let’s say I shoot a gun at, say, 20degrees angle of elevation, and it lands, say, 1000 meters away. I want to find the equation where if I input a range value into an equation I can solve for the angle of elevation value. I can do this by plotting a scatterplot where the x value is the degree and y is the range, yes? However, suppose I am on a hill and there is a target I want to hit 1000 meters away in a valley. If I fire at 20 degrees, I would overshoot the target because my elevation is higher than my target. How would I account for elevation in my equation, so that if I input a value for range and a value for elevation, I will receive a degree value, allowing me to hit the target even when I am on a separate elevation from the target?
You have a projectile with a certain initial velocity vector traveling along a certain trajectory. The trajectory is determined by the laws of physics. Yes, you can experiment and create a table of (angle, distance) pairs given that the gun and the target are at the same height. If they are not at the same height, it's not obvious to me how to adjust your table. Why not use the equation of the trajectory? If you solve it for the angle you'll have the function you are looking for: angle = f(target distance, elevation).
 
Well, the problem is, I'm working with incomplete information. See, I did some testing and using the quadratic regression function I figured out a rough equation that relates y (range) with x (degree), that being y=-0.8782699461x2+85.21901142x+143.7051. Now, this is pretty rough, I only did like half a trial and in the future i will try to refine this. I have virtually no other information, as this is all in the confines of a video game, so I cannot find out if the trajectory simulation in-game is based off of real-life values or otherwise. I'm pretty stumped as to how I can add elevation into this equation. Anyway, if it helps, I'm going to write the list of degree values and the range values i found correspond to that.

DegreeRange
1220
1.5270
2350
2.5350
3370
3.5430
4450
4.5450
5600
5.5600
6600
6.5700
7720
7.5740
8760
8.5800
9820
9.5850
10880
10.5970
111000
11.51000
That being said, I'm not asking for you guys to do any arithmetic or calculations, I only need to understand the process of how I would account for elevation in this equation so that I would be able to hit a target if given its altitude relative to me, and its range relative to me
 

Attachments

  • math how.png
    math how.png
    17.6 KB · Views: 1
From https://www.desmos.com/calculator/gjnco6mzjo

[MATH]y=h\ -\ 4.9\cdot\left(\frac{x}{v\cdot\cos\left(A\cdot\frac{\pi}{180}\right)}\right)[/MATH]
Maybe this formula is used. Plug in h=0, A=1, x=220, y=0 and figure out what v is.
Then solve the equation for A and you'll have a function that calculates the angle based on target position (x,y) and gun height.
 
From https://www.desmos.com/calculator/gjnco6mzjo

[MATH]y=h\ -\ 4.9\cdot\left(\frac{x}{v\cdot\cos\left(A\cdot\frac{\pi}{180}\right)}\right)[/MATH]
Maybe this formula is used. Plug in h=0, A=1, x=220, y=0 and figure out what v is.
Then solve the equation for A and you'll have a function that calculates the angle based on target position (x,y) and gun height.
alright i'll test that out tomorrow and see if that works
 
From https://www.desmos.com/calculator/gjnco6mzjo

[MATH]y=h\ -\ 4.9\cdot\left(\frac{x}{v\cdot\cos\left(A\cdot\frac{\pi}{180}\right)}\right)[/MATH]
Maybe this formula is used. Plug in h=0, A=1, x=220, y=0 and figure out what v is.
Then solve the equation for A and you'll have a function that calculates the angle based on target position (x,y) and gun height.
i clicked on the desmos link and it has some extra parts to the equation, are you sure it's just the part you listed or was that a mistake?
 
Top