plot boat heading

7 views (last 30 days)
Astrid
Astrid on 14 Apr 2012
Hello,
I would like to create a map, which shows my boat survey track and for each data point boat heading as a directional vector. I have lat, lon and boat heading(0-360degree) for each point. However, to create a directional vector (for example with quiver) I need U and V and I can't get my head around what I have to add as value to the boat heading. Unfortunatley I don't have data about boat speed. I created a vector of similar size with only ones, but somehow that doesn't work.
val=ones(length(track(1,1).hd),1);
quiver(track(1,1).lon,track(1,1).lat, track(1,1).hd, val,0)
Any suggestions of how I'm getting around this problem are highly appreciated!!
Many thanks for your help, Astrid

Answers (1)

Matt Kindig
Matt Kindig on 14 Apr 2012
My guess is that you would need to take the sine and cosine of the boat heading. Something like:
U = mag*cosd( track(1,1).hd);
V = mag*sind( track(1,1).hd);
where 'mag' is the magnitude (length) of the arrow that you want.

Categories

Find more on Vector Fields in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!