Take the 2-minute tour ×
Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free, no registration required.

first my actual problem. then my try on improving the current way of solving this with the wish for feedback or even a solution :)

gpx file with lat/long, elevation and time. wanna calculate speed... easy! when visualizing the speed on a chart you would figure it needs a little smoothing. done you have a pretty accurate speed, average-speed, max-speed...

...but i want more ;)

1) the coordinates are from an object that is adjusting there direction in a more or less smooth/curved fashion (aka. car, bike,...). thus smoothing the path would/could be nice. right? maybe something like a Bézier curve? but the path should still follow thru the actual measured points. any ideas?

2) smoother path would be generated by creating more points...right? so how do i split the time to the newly create points along the path in a similar way (so the new points along the path are timed like the measured ones)?

3) as long as the resulting data isn't less accurate i'm happy with it. still, feedback about how much or little improvement those calculations might bring are highly appreciated.

thx.

share|improve this question
2  
As described there isn't any actually physics here. Various splines are the standard solution to the general problem. Consider Stack Overflow, Stats.SE or SciComp.SE. –  dmckee May 7 '13 at 19:30
add comment

closed as off topic by dmckee May 7 '13 at 19:30

Questions on Physics Stack Exchange are expected to relate to physics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted

1) Spline curves are designed for just this sort of thing. A spline is basically a set of cubic (typically) polynomials at each section of your data that go exactly through your points. But since they're just cubic polynomials, they're pretty smooth. Assuming the path is a reasonably small portion of the earth, and the points are close together on a global scale, you can just apply a spline to the latitude as a function of time, then to longitude as a function of time, then to elevation as a function of time.

As an added bonus, most spline implementations will also let you take the derivative at any point along the spline. This gives you the speed -- up to appropriate factors because you're dealing with lat/long/elevation.

I don't know what sort of computer packages you have access to, but python's implementation can definitely do the job. (For specifics about that, it's probably better to ask on stackoverflow.)

2) I'm guessing you mean to use this smoother path as the source for those intermediate points? Then, you can just ask the spline to evaluate at a time that is halfway between two times that you have in your original data. How you do this depends on your computer package. (And again, is an issue better suited to stackoverflow.)

3) In terms of prettiness, this can certainly make things look much better, and it's generally a reasonable thing to do. But you have to remember that the points you don't have in your data will just be made up, regardless of what you do. A spline is good at giving you something that looks reasonable. But whether or not the gps actually traveled that path is anyone's guess.

share|improve this answer
1  
highly appreciate your most excellent help on this topic. thx. –  klemens May 7 '13 at 19:43
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.