이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
1 개 추천
I have three points P0=[x0,y0,z0], P1=[x1,y1,z1] P2=[x2,y2,z2] and I want to calculate the normal out of them what I did is
normal = cross(P0-P1, P0-P2);
and then I wanted to plot the normal so what I did is,
c = normal + P0 %end position of normal vector
quiver3(P0(1), P0(2), P0(3), c(1), c(2), c(3)); but it didn't work any suggestions please
%......Edited
채택된 답변
Matt Kindig
2013년 7월 30일
doc quiver3
댓글 수: 11
Jack_111
2013년 7월 30일
it didn't work
Matt Kindig
2013년 7월 30일
What didn't work about it? Did you read the documentation for quiver3?
Jack_111
2013년 7월 30일
yes I did but the line that I get is not the normal of the plane
Jack_111
2013년 7월 30일
I tried to insure if it is the normal or not by calculating the dot product but it wasn't zero dot(P0 - P1, normal)) and it was small number but not zero
Matt Kindig
2013년 7월 30일
편집: Matt Kindig
2013년 7월 30일
How close to zero was the dot product? Within numerical precision?
Jack_111
2013년 7월 30일
-8.271806125530277e-025 that was the answer but it must be zero
Jack_111
2013년 7월 30일
is it more helpful to put the entire code?
Matt Kindig
2013년 7월 31일
편집: Matt Kindig
2013년 7월 31일
-8.27180e-025 is probably as close to zero as you're going to get with Matlab (or for that matter, any computer program). In particular, it is probably within the eps() for your vectors.
Try this:
eps(P0)
what is this number? If it is larger than -8.278e-25, then you are within the precision of the calculation, and the answer cannot, in effect, be closer to zero.
Jack_111
2013년 7월 31일
The answer is larger than -8.278e-25
Matt Kindig
2013년 7월 31일
Then what I said above is correct. Your dot product is as close to zero as you'll be able to calculate. In other words, your calculated vector (from the cross product) is as close to normal to the plane as you'll be able to get.
I'm not really sure what else to say. Your code is correct, your answer is correct, and that's that. Read http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html for why exact floating-point calculations are not possible with a computer.
Jack_111
2013년 8월 1일
Thank you for your support
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
