plot boat heading
12 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Vector Fields についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!