<?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

Become a part of the TranceAddict community!Frequently Asked Questions - Please read this if you haven'tSearch the forums
TranceAddict Forums > Main Forums > Chill Out Room > Linear Interpolation???
Pages (2): [1] 2 »   Last Thread   Next Thread
Share
Author
Thread    Post A Reply
Joss Weatherby
Banned



Registered: May 2008
Location: The Pacific Northwest, of course
Read This! 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


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:

Old Post Oct-29-2009 21:06 
Click Here to See the Profile for Joss Weatherby Click here to Send Joss Weatherby a Private Message Visit Joss Weatherby's homepage! Add Joss Weatherby to your buddy list Report this Post Reply w/Quote Edit/Delete Message
shuni
Supreme tranceaddict



Registered: Sep 2006
Location: Tecate, Mexico


___________________
quote:
colonelcrisp
i bust my ass for the money i make
********
Oh so you are a male prostitute? That is such hard work taking dick? Now your ass can match your mouth.

Old Post Oct-29-2009 21:28  Mexico
Click Here to See the Profile for shuni Click here to Send shuni a Private Message Visit shuni's homepage! Add shuni to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Reza
Supreme tranceaddict



Registered: Jan 2005
Location: Richmond Hill

you'll get more answers if you post about:

Rape
Fart
Penis
********

Old Post Oct-29-2009 21:39  Canada
Click Here to See the Profile for Reza Click here to Send Reza a Private Message Add Reza to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Krypton
83.798 g/6.022x10^23



Registered: Nov 2003
Location: Texas


___________________

Old Post Oct-29-2009 22:05  Korea-Democratic Peoples Republic
Click Here to See the Profile for Krypton Click here to Send Krypton a Private Message Visit Krypton's homepage! Add Krypton to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Joss Weatherby
Banned



Registered: May 2008
Location: The Pacific Northwest, of course

Harpoons are sick.

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

This _has_ happened.

Old Post Oct-29-2009 22:36 
Click Here to See the Profile for Joss Weatherby Click here to Send Joss Weatherby a Private Message Visit Joss Weatherby's homepage! Add Joss Weatherby to your buddy list Report this Post Reply w/Quote Edit/Delete Message
tachobg
Junior tranceaddict



Registered: Jan 2006
Location: Cambridge, MA / NYC

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.

Old Post Oct-30-2009 01:33  Bulgaria
Click Here to See the Profile for tachobg Click here to Send tachobg a Private Message Add tachobg to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Joss Weatherby
Banned



Registered: May 2008
Location: The Pacific Northwest, of course

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.

Old Post Oct-30-2009 02:09 
Click Here to See the Profile for Joss Weatherby Click here to Send Joss Weatherby a Private Message Visit Joss Weatherby's homepage! Add Joss Weatherby to your buddy list Report this Post Reply w/Quote Edit/Delete Message
tachobg
Junior tranceaddict



Registered: Jan 2006
Location: Cambridge, MA / NYC

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?

Old Post Oct-30-2009 04:59  Bulgaria
Click Here to See the Profile for tachobg Click here to Send tachobg a Private Message Add tachobg to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Joss Weatherby
Banned



Registered: May 2008
Location: The Pacific Northwest, of course

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.

Old Post Oct-30-2009 05:18 
Click Here to See the Profile for Joss Weatherby Click here to Send Joss Weatherby a Private Message Visit Joss Weatherby's homepage! Add Joss Weatherby to your buddy list Report this Post Reply w/Quote Edit/Delete Message
iTranscendence
Supreme tranceaddict



Registered: Jul 2009
Location: The Biggest Little City

Triangulation?


___________________

Old Post Oct-30-2009 06:04  United States
Click Here to See the Profile for iTranscendence Click here to Send iTranscendence a Private Message Visit iTranscendence's homepage! Add iTranscendence to your buddy list Report this Post Reply w/Quote Edit/Delete Message
winston
ultraviolet catastrophe



Registered: Nov 2005
Location: Yggdrasill

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

Last edited by winston on Oct-30-2009 at 08:11

Old Post Oct-30-2009 07:44 
Click Here to See the Profile for winston Click here to Send winston a Private Message Add winston to your buddy list Report this Post Reply w/Quote Edit/Delete Message
Joss Weatherby
Banned



Registered: May 2008
Location: The Pacific Northwest, of course

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.

Old Post Oct-30-2009 08:43 
Click Here to See the Profile for Joss Weatherby Click here to Send Joss Weatherby a Private Message Visit Joss Weatherby's homepage! Add Joss Weatherby to your buddy list Report this Post Reply w/Quote Edit/Delete Message

TranceAddict Forums > Main Forums > Chill Out Room > Linear Interpolation???
Post New Thread    Post A Reply

Pages (2): [1] 2 »  
Last Thread   Next Thread
Click here to listen to the sample!Pause playbackTrack # 11 From Emphased Reality - Other Worlds 029 08-16-06 [2007] [0]

Click here to listen to the sample!Pause playbackFerry Corsten - "Fire" [2005]

Show Printable Version | Subscribe to this Thread
Forum Jump:

All times are GMT. The time now is 22:03.

Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
HTML code is ON
vB code is ON
[IMG] code is ON
 
Search this Thread:

 
Contact Us - return to tranceaddict

Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
Support TA!