Reflection Problem

A Given plane Ax + By + Cz = D and a point x in a room, calculate reflection of x in the plane.
Function file : function s=mirror(x, A, B, C, D)
Input : The point x and the parameters in the plane equation.
Output : The reflection s.
And so far I have wrote this:
function s = spegel(x,A,B,C,D)
normvect = [A;B;C;];
length = norm(normvect);
d = D/length;
n = normvect/length;
s = x + 2*(d - dot(x,n))*n;
end
But what value of x and parameters should I use? I am asking because the values I choose got wrong. And it should be okay to choose any value I want it? Or is the code wrong?
Regina

回答 (0 件)

カテゴリ

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

質問済み:

2012 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by