plot boat heading

12 次查看(过去 30 天)
Astrid
Astrid 2012-4-14
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

回答(1 个)

Matt Kindig
Matt Kindig 2012-4-14
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.

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by