필터 지우기
필터 지우기

orthagonal planes and normal vectors

조회 수: 32 (최근 30일)
M
M 2020년 11월 22일
편집: David Goodmanson 2020년 11월 25일
I have three planes:
3x +2y -z =18
3x - 8y -7z = -38
-22 + 18 -30 = -6
And I'd like to find normal vector to those planes, and then chech if these vectors are orthagonal to themselves, then check the if the planes are orthagonal. How can I do this thing? I'd be greateful for any help in this matter.

채택된 답변

David Goodmanson
David Goodmanson 2020년 11월 23일
Hi M,
A plane satisfies the dot product equation equation
r dot v = const
where r is the position vector [x y z] and v = [vx vy vz] is a vector perpendicular to the plane. A vector perpendicular to the first plane is
v1 = [3 2 -1];
because dotting that into [x y z] produces the equation for the first plane. Similarly for the other two. A unit vector perpendicular to the plane is
n1 = v1/norm(v1) % normalized vector perpendicular to plane
and similarly for the other two. Then dot(n1,n2) tellls you if n1 and n2 are orthogonal, and similarly for the other possible pairs.
Planes are orthogonal if and only if their normal vectors are orthogonal.
  댓글 수: 2
M
M 2020년 11월 23일
v1 = [3 2 -1];
v2 = [3 -8 -7 ];
v3 = [-22 18 -30 ];
n1 = v1/norm(v1);
n2 = v2/norm(v2);
n3 = v3/norm(v3);
ort12 = dot(n1,n2); % = 0
ort13 = dot(n1,n3); % != 0
ort23 = dot(n2,n3); % != 0
p1 = dot(v1,v3) % = 0
p2 = dot(v1,v2) % = 0
p3 = dot(v2,v3) % = 0
In my case it's like normalized vectors aren't ortagonal(cause result 0 is only for the ort12 variable) but when I check planes it's ok. What did I understand wrong?
David Goodmanson
David Goodmanson 2020년 11월 25일
편집: David Goodmanson 2020년 11월 25일
Hello M,
there is not anything wrong here. For dot(n1,n3) and dot(n2,n3), the difference from 0 is down around 5e-17. This result is more or less expected. n1,n2 and n3 are vectors whose elemenrts are floating point numbers, not integers, and sizewise are in the general vicinity of 1. In Matlab, floating point double precision numbers have 16 decimal places. So for a vector element around 1, a value like 5e-17 is down around the last decimal place, which is the limit of precision. When doing the dot calculation, some imprecision down around the order of 5e-17 is expected, and that's what you get.
It so happens that v1, v2 and v3 have elements that are integers, so the dot products of those come out to be exactly zero.

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

추가 답변 (1개)

Matt J
Matt J 2020년 11월 23일
편집: Matt J 2020년 11월 23일
format long;
A=normalize( [3,2,-1; 3,-8,-7;-22,18,-30] ,2,'norm');
If they are orthogonal, this should give the identity matrix, within floating point errors:
A*A.',
ans = 3×3
1.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 1.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000 1.000000000000000
Looks like they are!!
  댓글 수: 2
M
M 2020년 11월 23일
what does " .', " operator actually do?
Matt J
Matt J 2020년 11월 23일
A.' the transpose of A.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by