現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
