Create orthonormal basis from a given vector

55 ビュー (過去 30 日間)
Justin Solomon
Justin Solomon 2013 年 4 月 18 日
Hello,
I need to create an orthonormal basis from a given input vector. For example, say I have the vector u=[a b c]; In my new coordinate system, I'll let u be the x-axis. Now I need to find the vectors representing the y-axis and the z-axis. I understand that this problem doesn't have a unique solution (i.e., there are an infinite number of possible vectors that will represent the y and z axes). I really just need one solution, it doesn't have to be unique.
Any ideas?
(Just to clarify, in 2D if u=[1 1], the y-axis is v=[-1 1]. I need to do something similar in 3D and with arbitrary u)

採用された回答

Matt J
Matt J 2013 年 4 月 18 日
編集済み: Matt J 2013 年 4 月 18 日
x=u(:).'/norm(u);
yz=null(x).';
xyz=[x;yz]; %The rows of this matrix are the axes

その他の回答 (2 件)

Kye Taylor
Kye Taylor 2013 年 4 月 18 日
編集済み: Kye Taylor 2013 年 4 月 18 日
So, given vector
v = [a;b;c];
in R^3, it follows that any point (x,y,z) that satisifies a*x + b*y + c*z = 0 (i.e. a point that lives on plane whos normal vector is v) will define components of a vector that is orthogonal to v.
One such vector is
u = [0;-c;b];
or, for example,
u = [-c,0,a];
(you can choose whatever you prefer, but it cannot be [0;0;0])
... Now, given u and v, compute the third vector that is orthogonal to both u and v with
w = cross(u,v);
To make an orthonormla basis use
u1 = u/norm(u);
v1 = v/norm(v);
w1 = w/norm(w);

Justin Solomon
Justin Solomon 2013 年 4 月 18 日
Thanks! Both of these are fine solutions!

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by