フィルターのクリア

Angle between a vector and xy, xz, and yz planes

11 ビュー (過去 30 日間)
Mel A
Mel A 2023 年 7 月 24 日
編集済み: Matt J 2023 年 7 月 24 日
Hi
I have a vector defined by P1. [12,14,78]
How can I caculate the angle this forms with the xy, xz an yz planes pls.
I can do with atan(x/y) etc, but this is problematic when the angle is over 90 or 180.
What would be the best approach pls
  4 件のコメント
Bruno Luong
Bruno Luong 2023 年 7 月 24 日
編集済み: Bruno Luong 2023 年 7 月 24 日
From your graph it looks to me the angles are between vector P and basis vectors and not the planes
Mel A
Mel A 2023 年 7 月 24 日
Yes, you are right. Angle with the base vector on xy( or other) plane. How could I calculate it allowing for more than 90 deg angles Pls. Thanks a lot

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

回答 (2 件)

Bruno Luong
Bruno Luong 2023 年 7 月 24 日
編集済み: Bruno Luong 2023 年 7 月 24 日
P1=[12,14,78]
P1 = 1×3
12 14 78
xyzc=num2cell(eye(3),1)
xyzc = 1×3 cell array
{3×1 double} {3×1 double} {3×1 double}
[x,y,z]=deal(xyzc{:});
rad2deg(subspace(P1(:),[x y]))
ans = 76.6995
rad2deg(subspace(P1(:),[x z]))
ans = 10.0596
rad2deg(subspace(P1(:),[y z]))
ans = 8.6107

Matt J
Matt J 2023 年 7 月 24 日
編集済み: Matt J 2023 年 7 月 24 日
P1=[12,14,78];
Angles = 90 - acosd(normalize(flip(P1),'n'))
Angles = 1×3
76.6995 10.0596 8.6107

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by