Why I'm getting a complex degree value while using "acos"?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Abb
am 10 Jun. 2023
Kommentiert: Image Analyst
am 11 Jun. 2023
% To reproduce the snippet, you can use below code
XYZc = [2489011.31135707, 7440368.1011554, 17.6551714555564];
X0 = 2489018.662
Y0 = 7440333.989
Z0= 10.091
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)
1 Kommentar
Matt J
am 10 Jun. 2023
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.
Akzeptierte Antwort
Matt J
am 10 Jun. 2023
Bearbeitet: Matt J
am 10 Jun. 2023
Because abs(dir_mag2/dir_mag1) is greater than 1.
abs(dir_mag2/dir_mag1)
13 Kommentare
Image Analyst
am 11 Jun. 2023
It's not in the comments, neither his nor yours. It should be above, at the very first answer post of @Matt J
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!