Angle between two planes given xyz coordinate data from each plane

17 Ansichten (letzte 30 Tage)
I have 4 points in one plane and 3 points on another plane. How do I use this data to calculate the angle between the two planes generated by the xyz coordinates? Here is what I have tried so far, but I don't get a number as an answer. Any help would be appreciated!
%Proximal Plane
P1 = [1,-1,3];
P2 = [2,3,4];
P3 = [-5,6,7];
normal = cross(P1-P2, P1-P3);
syms x y z
P_p = [x,y,z]
realdot = @(u, v) u*transpose(v);
planefunction = realdot(normal, P_p-P1);
%Distal Plane
P4 = [4,-2,4];
P5 = [1,7,5];
P6 = [-3,5,9];
normal2 = cross(P4-P5, P4-P6);
syms x1 y1 z1
P_d = [x1,y1,z1]
realdot = @(u, v) u*transpose(v);
planefunction2 = realdot(normal2, P_d-P4);
angle = acosd((realdot(P_p,P_d)/norm(P_p)*norm(P_d)))

Akzeptierte Antwort

David Hill
David Hill am 8 Sep. 2022
P1 = [1,-1,3];
P2 = [2,3,4];
P3 = [-5,6,7];
normal = cross(P1-P2, P1-P3);
P4 = [4,-2,4];
P5 = [1,7,5];
P6 = [-3,5,9];
normal2 = cross(P4-P5, P4-P6);
Angle=acosd(abs(sum(normal.*normal2))/norm(normal)/norm(normal2));
  2 Kommentare
James Tursa
James Tursa am 9 Sep. 2022
Or
Angle = atan2(norm(cross(normal,normal2)),dot(normal,normal2));
Gabriella Sandberg
Gabriella Sandberg am 9 Sep. 2022
If I use the tan function over the cos function, would it calculate the same angle? Thank you both for your input.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by