<?php
$g = 12350;
$a = -40;
$a1 = -100;
$a2 = 0;
$g1 = 12300;
$g2 = 12400;
$d1 = 983.24;
$d2 = 974.35;
$x1 = 979.68;
$x2 = 970.79;
$y1 = $d1+(($g-$g1)/($g2-$g1))*($d2-$d1);
$y2 = $x1+(($g-$g1)/($g2-$g1))*($x2-$x1);
$y = $y1+(($a-$a1)/($a2-$a1))*($y2-$y1);
print $y . "\n";
TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Linear Interpolation???
Linear Interpolation???
Does linear interpolation work on ballistic trajectories???
I am using this one interpolation algorithm on a 3D data table, and I am getting the wrong results.
Minus the 3D part table, can you use linear interpolation to interpolate angles of elevation for different ranges?
ex:
range elevation
4500 55.6
4600 54.3
PHP:

you'll get more answers if you post about:
Rape
Fart
Penis
********

Harpoons are sick.
They can lock on and seek out those little swipe pay things at gas stations... 
This _has_ happened.
are you saying that you have a list of (elevation, range) pairs and you want to calculate elevation E for a given range R that does not appear in the list?
If that's the problem, there should be an equation that relates elevation to range. Can't you just use that? If I misunderstood and it's a more general data fitting problem, then read on.
The problem of discovering the relationship between a bunch of data points is not always trivial. Most of the time, it is not linear either. Say I plotted random points from a sine curve. You wouldn't try to fit a line to those points because they aren't related according to a line. If you do, you'd get the wrong predictions for what the data looks like in general.
The problem of finding the right type of curve to fit (line, parabola, whatever) is called model selection. The family of curves that you consider for fitting the data (say, the family of all parabolas) is called the model. The problem of finding the best particular curve in the chosen model is called estimation.
So, you have to answer two questions - 1) what model is best for relating elevation and range 2) how do i find the best function from this model to fit the data.
Yea, its a table of ranges.
Each row represents a different range in increments of 100 meters, and each column is the elevation it takes to hit that range at different altitude differences, starting at -1000 and going to 1000 in increments of 100.
Seems like the most straightforward thing to do is work out the math and come up with a formula relating elevation, altitude and range. Where did the data come from in the first place?
| quote: |
| Originally posted by tachobg Seems like the most straightforward thing to do is work out the math and come up with a formula relating elevation, altitude and range. Where did the data come from in the first place? |
Triangulation?
ideal projectile motion with different launch angles, you use pythagoras to calculate the angles, you need to compute the trajectory. calculate velocities using kinematics. remember, during ideal projectile motion x and y axis are independent of each other, x axis is constant! therefore, there will only be change in the y direction. its motion will be projected differently along each axis. read up on ideal projectile...to get an idea of where to begin digging for an algorithm that solves your dilemma.
here...to set you off:
displacement at vertical axis.
initial vertical velocity
time - quadratic square root added
Range given projection angle and
equal initial and final elevations
range

I have the trajectory calculations down pat, but they are too slow, taking many thousands of iterations to get the correct angles.
I just need to know what kind of interpolation needs to be done on sampled trajectory data to get more accurate results than I am getting now.
I am getting results that are sometimes 4-5 milliradians in elevation off, which on a low angle trajectory can result in rounds landing almost 150 meters off target.
| quote: |
| Originally posted by Joss Weatherby I have the trajectory calculations down pat, but they are too slow, taking many thousands of iterations to get the correct angles. I just need to know what kind of interpolation needs to be done on sampled trajectory data to get more accurate results than I am getting now. I am getting results that are sometimes 4-5 milliradians in elevation off, which on a low angle trajectory can result in rounds landing almost 150 meters off target. |
maybe you can use a higher order interpolation. You can look up an algorithm for some polynomial, like quadratic / cubic or spline interpolation. Or, if you have access to matlab, you can easily generate a polynomial function for your data...if you have the entire data set before hand that is. If not matlab, maybe excel can do it. You will have to check.
Why don't you draw the expected curve and show us what exactly is the issue ? Maybe you can also supply the table of data points that you are using.
Basically just split off the amount of pure vertical component of the projectile, see how long it takes gravity to decelerate that to 0, then how long it takes for that to fall from the height it reaches.
Then you have the time, just calculate how far horizontally it would travel in that time (also include any air resistance deceleration).
If it is taking too long, don't actually calculate it, just use look-up tables (if it doesn't have to be uber accurate, and you have plenty space).
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.