# SparkFun Forums

### How to calculate G loads from the position coordinates?

Tips and questions relating to the GPS modules from SFE

### How to calculate G loads from the position coordinates?#19103

By MrAWD
#19103
Hi there!

I was wondering if there are already written algorithms for the calculation of the lateral and longitudinal acceleration from the GPS coordinates? I believe that lot of other people have faced with similar problem so I was wondering if someone could point me to the good source.

Thanks a lot!

Fedja

### #19105

By reklipz
#19105
As I've never touched a GPS before, you may want to double check what I say.

Anywho, accelleration is simply a change in velocity over time, and to calculate it, you would need to get this from the GPS:
position, time of this position
2nd position, time of this position
3rd position, time of this position

then, you calculate the velocity between the two sets of points, like so:
distance between position 1 and position 2 / difference in time
and the same for the 2nd set

then, to calculate accelleration:
velocity @ point 3 - velocity @ point 2 / time from point 2 to point 3

And bam, you've got acceleration!

To calculate the accelleration on seperate axis (probably a pain!)
you would have to seperate the positions into longitude and latitude, and just do the calculations seperatly for the two.

This sound right?

### Re: How to calculate G loads from the position coordinates?#19108

By NleahciM
#19108
MrAWD wrote:Hi there!

I was wondering if there are already written algorithms for the calculation of the lateral and longitudinal acceleration from the GPS coordinates? I believe that lot of other people have faced with similar problem so I was wondering if someone could point me to the good source.

Thanks a lot!

Fedja
So you have the GPS signal coming in at 1hz, and want to get a lat and long acceleration from that data? Do you want the units of the acceleration in degrees/seconds^2 or in meters/seconds^2? If the former, the above answer is right on. If the latter, it gets a bit more complicated - you'd have to convert the changes in lat and long into changes in position (there are formulas for this, of varying accuracy and complexity) and then you'd take the acceleration from that data.

### Re: How to calculate G loads from the position coordinates?#19127

By MrAWD
#19127
NleahciM wrote: So you have the GPS signal coming in at 1hz, and want to get a lat and long acceleration from that data? Do you want the units of the acceleration in degrees/seconds^2 or in meters/seconds^2? If the former, the above answer is right on. If the latter, it gets a bit more complicated - you'd have to convert the changes in lat and long into changes in position (there are formulas for this, of varying accuracy and complexity) and then you'd take the acceleration from that data.
Well, speed of the incoming signal is not an issue here since it depends of the receiver that is used for it.

Yes, I would like to get the numbers in meters/sec*s so it can be converted into the G units. The thing is that I know the logic and the math required, but instead of writing my own algorithm I was hoping that there is one available somewhere so I could use my discrete input points and get the calculation right out.

Fedja