From vertices to Equations of the Plane

Hi!
I was wondering whether there is a Matlab function which can calculate the equation of a plane from the vertices. Let's say that I have the following three vertices:
(0,0,0), (2,3,6) and (3,1,5)
Then I would like to have a function that gets these vertices as input and gives me the equation of a plane as output, which is 9x+8y-7z+0=0. In fact, I found such a tool online: http://keisan.casio.com/exec/system/1223596129
but I would like to have the same function in Matlab (preferably the one which also can handle more dimensions).
Does such a function exist?
Thanks!
Alex

1 件のコメント

sixwwwwww
sixwwwwww 2013 年 10 月 17 日
編集済み: sixwwwwww 2013 年 10 月 17 日
Do you like this function to be written? or you need some pre-defined function in MATLAB for this purpose?

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

 採用された回答

Cedric
Cedric 2013 年 10 月 17 日
編集済み: Cedric 2013 年 10 月 17 日

0 投票

Hint: you can start with the following and implement the few additional computations required (realizing that a 4th parameter must be computed)..
>> v1 = [0,0,0] ; v2 = [2,3,6] ; v3 = [3,1,5] ;
>> n = cross(v2-v1, v3-v1)
n =
9 8 -7

その他の回答 (1 件)

Matt J
Matt J 2013 年 10 月 17 日
編集済み: Matt J 2013 年 10 月 17 日

0 投票

The equality constraints give the equation for the plane. You can ignore the inequality constraints.
It will also handle N-dimensions, for N not too large.

1 件のコメント

Matt J
Matt J 2013 年 10 月 17 日
編集済み: Matt J 2013 年 10 月 17 日
So, using your example data
>> [~,~,Aeq,beq]=vert2lcon([0 0 0; 2 3 6; 3 1 5]);
>> s=9/Aeq(1); Aeq=s*Aeq, beq=s*beq
Aeq =
9.0000 8.0000 -7.0000
beq =
0

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

カテゴリ

ヘルプ センター および File ExchangeData Type Identification についてさらに検索

タグ

質問済み:

2013 年 10 月 17 日

編集済み:

2013 年 10 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by