0

I am working with a car and trailer model which has a GPS sensor attached and I am looking for ways to calculate it's yaw (orientation).

One way I am working on is two resolve both the car and trailer into coordinates and use them to find the angles.

I have the length of the car and its x and y cordinates. So the car's length serve as my hypotenuse and the latitude and longitude coordinates serves as my base and perpendicular given by the GPS for all time. My question now is that are there any formulas that I can use to obtain yaw for my car and/or trailer. I can compute all the angles within the triangle using cosine and sine law.

Staph
  • 1
  • Latitudes and longitudes are not cartesian coordinates. You are attempting to use 2D plane trigonometry on the curved Earth surface. What you need is at least Spherical Trigonometry in order to compute the bearing between two pairs of coordinates, like this : θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ) where θ = bearing; Δλ = difference in longitude between both points; φ1 and φ2 the latitudes of the first and second point. – FSimardGIS Apr 18 '19 at 23:39
  • It's not clear to be how you are attempting to get coordinates for both your car and the trailer (simultaneously with a single gps unit?) But a possible way to obtain pairs of coordinates would be to record points every few seconds and use the last two points to calculate your current bearing. This would at least give you the current direction the car is going. – FSimardGIS Apr 18 '19 at 23:47

0 Answers0