Orthogonal vectors, how to code?

Hi,
I am trying to put in my code that two vectors w⃗ = (w1, w2, w3) and ⃗v = (v1, v2, v3), with the lenght of 1, are orthogonal to each other and have the first coordinate 0. I am able to solve this as an equation system on paper but I am also tying to solve it in matlab. I have come up with the following, but I do not know how to say that the vectors are orthogonal to each other. Any ideas?
v1 = [0 u(3) u(2)];
v1 = v1 / norm(v1);

3 Kommentare

Steven Lord
Steven Lord am 19 Nov. 2019
Editing away your questions, as you did with your previous question, means that others can't learn from that discussion. What guarantee do I have that if I were to answer you wouldn't simply edit away this question?
Jenny Andersen
Jenny Andersen am 20 Nov. 2019
Sorry about that! I will try and fix it.
Jan
Jan am 20 Nov. 2019
I do not undestand the question. Do you want to check if the vectors are orthogonal or do you want to create an orthogonal vector?
Two vectors [w1, w2, w3] and [v1, v2, v3] with w1=0 and v1=0 are orthogonal, if w2*v2 + w3*v3 == 0.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 20 Nov. 2019
Bearbeitet: Matt J am 20 Nov. 2019

0 Stimmen

Any two such vectors will have this parametric form,
w= [0 cos(theta) sin(theta)]
v=c*[0 -sin(theta) cos(theta)]
where c=+1 or -1.

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 19 Nov. 2019

Bearbeitet:

am 20 Nov. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by