<?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";
Linear Interpolation??? - TranceAddict Forums - Chill Out Room
return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

Pages: [1] 2 
Linear Interpolation???
View this Thread in Original format
Joss Weatherby
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


I tried but I get results that are slightly off, I am wondering since its not a linear decline between values that my algorithm is wrong...

This is it, including the 3D jump in data... since I need to interpolate two different elevations correlating to altitude for each row relating to range...

PHP:

shuni
rT19
you'll get more answers if you post about:

Rape
Fart
Penis
********
Krypton
Joss Weatherby
Harpoons are sick.

They can lock on and seek out those little swipe pay things at gas stations... :D

This _has_ happened.
tachobg
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.
Joss Weatherby
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.
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?
Joss Weatherby
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?


I am generating the data via another algorithm, the reason I have to do it via a ballistics table is that when I try and run this in the game I am using it is too slow, often taking 70 seconds to generate one solution.

I will need to generate at least 8 solutions fairly quickly based off of different initial velocities and whether or not I want to use a high angle or low angle trajectory.
iTranscendence
Triangulation?

winston
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

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.
CLICK TO RETURN TO TOP OF PAGE
Pages: [1] 2 
Privacy Statement