2
我有幾百個點。連接它們會給我幾百架飛機。我需要控制法向矢量的方向,以便我總是從建築物外面看這架飛機。控制法向矢量的方向,matlab
這裏有幾點。
XYZ=[1,26.7801084079290,10.9279762852855,5.90125567150161;
1,26.7801084079290,10.6329762852855,5.90125567150161;
1,26.7801084079290,10.6329762852855,7.78125567150161;
1,26.7801084079290,10.9279762852855,7.78125567150161;
1,26.7801084079290,10.9279762852855,5.90125567150161;
2,31.2001083983270,10.9279762852855,5.89675567150161;
2,31.2001083983270,10.6329762852855,5.89675567150161;
2,31.2001083983270,10.6329762852855,7.77675567150161;
2,31.2001083983270,10.9279762852855,7.77675567150161;
2,31.2001083983270,10.9279762852855,5.89675567150161;
2,31.2001083983270,10.9279762852855,5.89675567150161;]
擬合平面最小二乘法給我folloing參數
1 1 0 0 26.78 % [plane number, n, d]
2 1 0 0 31.2
繪製這些點
,因爲我從外面看在建築內部,飛機數字2是好的。但是我怎樣才能改變飛機1的方向。它向我展示了建築物內部的正常方向,它應該是反方向的。
注意:我有數百個平面,所以我需要一些系統的方法來使這些平面法線正確。
%-----------------------編輯--------------------- ---------------------------------%
%對於順時針和逆時針 %我正在變得相同導致
XYZ=[1,26.7801084079290,10.9279762852855,7.78125567150161;
1,26.7801084079290,10.6329762852855,7.78125567150161;
1,26.7801084079290,10.6329762852855,5.90125567150161;
1,26.7801084079290,10.9279762852855,5.90125567150161;
2,26.7801084079290,10.6329762852855,5.90125567150161;
2,26.7801084079290,10.6329762852855,7.78125567150161;
2,26.7801084079290,10.9279762852855,7.78125567150161;
2,26.7801084079290,10.9279762852855,5.90125567150161; ]
@ Blau請參閱編輯。 – Shahgee 2013-04-29 13:10:19