Plot a unit vector in MATLAB, given its starting point and the orientation about 3 axes

37 ビュー (過去 30 日間)
I have a point [x y z] and the Euler orientation angles [r p y]. How can I plot a unit vector in MATLAB starting from [x y z] in the orientation of [r p y] ?
  3 件のコメント
crisdeodates
crisdeodates 2019 年 11 月 22 日
Thanks Adam, but my requirement is to use Euler angles to plot a unit vector starting at the specified point. And my goal is to get the plot in 3D.
Adam Danz
Adam Danz 2019 年 11 月 22 日
編集済み: Adam Danz 2019 年 11 月 22 日

サインインしてコメントする。

採用された回答

crisdeodates
crisdeodates 2019 年 11 月 22 日
編集済み: crisdeodates 2019 年 11 月 22 日
At last found a very simple solution.
Converted the euler angles to rotation matrix and rotated to unit vector.
  2 件のコメント
Adam Danz
Adam Danz 2019 年 11 月 22 日
Congrats! If you provide a simple demo or example in your answer it will be more useful to people who may come across this post in the future.
crisdeodates
crisdeodates 2019 年 11 月 22 日
編集済み: crisdeodates 2019 年 11 月 22 日
Sure ...
Lets say we want to visualize a vector at a given point [0 0 10] and orientation [0 0 50].
  1. Convert the orientation angles to radians using deg2rad function.
  2. Find the rotational matrix using eul2rotm function in the sequence (eg: XYZ) required.
  3. Initialize a unit vector along x-axis as [1 0 0].
  4. Rotate the unit vector using the rotational matrix obtained in step 2.
  5. Plot the newly formed directional vector usingquiver3 function.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange3-D Scene Control についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by