# Intentionally offset GPS coordinates using heading [closed]

Is there a known way of intentionally offsetting a latitude/longitude position by using a combination of the latitude/longitude and heading? I'm struggling to find any kind of answer or solution for this...

[Edit Partial Solution]

I came across this link which is what my code below is based on below which I think was a link within the Richard's link below.

As can be seen in the image below, I wanted to purposely introduce an offset which can be seen in the points highlighted in 'yellow' are offset by about 10 meters.

This does not hold true for some coordinates (i.e. I don't observe a consistent offset), which I am assuming depends on using the heading value, which I believe comes back to my original question, I believe use of the heading in a calculation is required.

I will continue my search and update if i I come across a solution for the next person.

#include <math.h>
void function(double lat_in, lon_in, double offset_mtr, double *lat_out, double *lon_out)
{
double dLat = 0.0;
double dLon = 0.0;
if( (lat_out != NULL) && (lon_out != NULL) )
{

(*lat_out) = lat_in + dLat * 180/M_PI;
(*lon_out) = lon_in + dLon * 180/M_PI;
}
}

• Support for recording GPS positions at an offset from the unit's actual location varies among GPS hardware. What kind of GPS unit are you using? Please add that to your question. Also, you would need an offset distance in addition to a heading. Apr 25 '19 at 16:38
• Any GIS software will have a tool for translating/offsetting points. Usually these tools take input in the form of X and Y offset distances. X and Y offset distances can be calculated from your heading and distance using sin() and cos() functions.
– csk
Apr 25 '19 at 17:32
• Does this question help? gis.stackexchange.com/q/240071/43 This question also points to several other related questions. Apr 25 '19 at 17:36