필터 지우기
필터 지우기

Why I'm getting a complex degree value while using "acos"?

조회 수: 3 (최근 30일)
Abb
Abb 2023년 6월 10일
댓글: Image Analyst 2023년 6월 11일
% To reproduce the snippet, you can use below code
XYZc = [2489011.31135707, 7440368.1011554, 17.6551714555564];
X0 = 2489018.662
X0 = 2.4890e+06
Y0 = 7440333.989
Y0 = 7.4403e+06
Z0= 10.091
Z0 = 10.0910
dir_vec1 = XYZc-[X0, Y0, Z0];
dir_mag1= norm(dir_vec1);
dir_vec2 = [0,XYZc(2),0]-[X0, Y0, Z0];
dir_mag2= norm(dir_vec2);
alpha = acosd(dir_mag2/dir_mag1)
alpha = 0.0000e+00 + 6.7868e+02i
  댓글 수: 1
Matt J
Matt J 2023년 6월 10일
I have edited your post for you to make your code output visible. It is always advisable to do this so we can see what output you are talking about.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2023년 6월 10일
편집: Matt J 2023년 6월 10일
Because abs(dir_mag2/dir_mag1) is greater than 1.
abs(dir_mag2/dir_mag1)
ans = 6.9710e+04
  댓글 수: 13
Abb
Abb 2023년 6월 11일
편집: Abb 2023년 6월 11일
@Matt J I do not see "Accepted Answer" in this comment! can you please enable it?
Image Analyst
Image Analyst 2023년 6월 11일
It's not in the comments, neither his nor yours. It should be above, at the very first answer post of @Matt J

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by