plotting normal vector in 3d

25 ビュー (過去 30 日間)
Jack_111
Jack_111 2013 年 7 月 30 日
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
Matt Kindig 2013 年 7 月 30 日
  11 件のコメント
Matt Kindig
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
Jack_111 2013 年 8 月 1 日
Thank you for your support

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFloating-Point to Fixed-Point Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by