# Thread: Unit vector n perpendicular

1. ## Unit vector n perpendicular

Hi!

I am having a problem with the following, can anyopne help?

Find a unit vector u perpendicular to both the vectors
p = (2,1,2) and q = (2,2,0)

Here's were I have got

Let u = (x,y,z)

|u| = 1 -> |u|^2 = 1
-> x^2+y^2+z^2 = 1 (1)

u . p = 0 -> x*2 + y*1 + z*2 = 0
-> 2x +y +2z = 0 (2)

u . q = 0 -> x*2 +y*2 + z = 0
-> 2x + 2y =0
-> x = -y (3)

Substitute z for y in (1) and (2)

x^2+z^2+z^2 = 1 -> x^2 + 2z^2 = 1 (1')
2x + z + 2z = 0 -> 2x + 3z = 0 (3')

Substitute -2x for z in (1')

x^2 + 2(-2x)^2 = 1 -> 9x^2 =1 -> x = +/- 1/3

When x = 1/3 y = -1/3 and z = -2/9 using (3) and (3')

but (1/3)^2 + (-1/3)^2 + (-2/9)^2 does not equal 1 as it should according to (1)

I am not sure what to do next. Can anyone help?

2. Your u.q is incorrect. It should be 2x + 2y = 0. As for overall strategy, I would find the parametric solution of your two equations, and then normalize the result (divide the resulting vector by its length).

An alternative solution would be to take the cross product of p and q, and normalize the result.

3. with the correct equation for u.q, we get 2x + 2y = 0, so y = -x. so u is of the form: (x,-x,z).

now we just have one equation left, to take care of TWO variables, so one of the variables must be free.

which one you choose to be free is largely a matter of choice. in this case, i would choose z to be free,

to avoid fractional values as long as possible (you'll have fractions, eventually, when you normalize u).

4. Sorry I am lost here, can you give me a little more help on what I should do after,

u.q = 0 where y = -x (3)

How do I solve (1),(2),(3)

5. Solve (2) and (3) to obtain a one-parameter family of solutions. You should get a straight line:

Then take the vector x and normalize it: divide it by its length.

6. if y = -x, substituting back in (2) yields:

2x - x + 2z = 0 -->
x = -2z --> u = (-2z,2z,z) = z(-2,2,1) + (0,0,0).

"z" is our parameter here, we can pick it freely to get any vector that lies on the line z(-2,2,1).

of course, we don't want just "any" vector, we want a UNIT vector.

the equation i have above is the same thing as Ackbeet is saying: his "t" is my "z", his vector "m" is my "(-2,2,1)" and his "b" is my "(0,0,0)".

a parameter is the same thing as a "free variable", the other variables, x and y, (in this case) are "bound" or "dependent" variables

because they depend on the parameter (if you choose z, that automatically forces what x and y have to be).

in 3 dimensions, a line behaves just the same as in 2 dimensions, there's just "more stuff" to specify.

what do we need to specify? which way the line goes (which direction), and where to start from (some point ON the line).

the direction of the line we're interested in, is determined by p and q, we want it to be perpendicular to the plane

they lie in. this forces constraints on which directions are possible. we have 3 possible independent choices:

x, y and z, but since we have a plane determined by p and q, that gives us 2 equations in 3 unknowns.

we can eliminate any 2 of the unknowns, which gives us the "mt" part.

in this case, our equations are homogeneous (one side is 0), so we can use the most convenient "b" of all, namely, (0,0,0), the origin.

7. Originally Posted by Arron
Find a unit vector u perpendicular to both the vectors p = (2,1,2) and q = (2,2,0)

8. Originally Posted by Ackbeet
An alternative solution would be to take the cross product of p and q, and normalize the result.
Originally Posted by Plato
^