5

I have a data set containing the recorded data from a car's motion (latitude,longitude, and heading). I'd like to plot the (lat,lon) points on a 2D plot with a unit vector pointing in the direction of the car's heading at each point. The heading is given in azimuth degrees so I think I would first have to convert that to radians then calculate the (x,y) point that represents the head of the unit vector.

I don't have any trouble plotting the (lat,lon) points but I have no idea about the vectors. I'm pretty new to Octave but I do know at least basic C/C++. An animated plot would be even better if anyone knows how to set that up.

JDD
  • 153
  • 1
  • 3

1 Answers1

4

The command you are likely looking for is quiver. It only does 2D vector field plots, and you may have to normalize your vector lengths yourself. It also requires that all of your points be on a rectangular grid, although there is likely a work around for that.

quiver(x, y, u, v);

For an animated plot, you want to draw a single location and vector(still using quiver) inside a loop and use the pause command for animation. Since this sounds a little like a homework problem I will leave the details to you.

Godric Seer
  • 4,637
  • 2
  • 23
  • 38