46
$\begingroup$

For example we have the vector $8i + 4j - 6k$, how can we find a unit vector perpendicular to this vector?

$\endgroup$
1
  • $\begingroup$ Very nice. Here's an extension which requests that the unit vector has rational components. $\endgroup$ Dec 16, 2020 at 22:18

11 Answers 11

36
$\begingroup$

Let $\vec{v}=x\vec{i}+y\vec{j}+z\vec{k}$, a perpendicular vector to yours. Their inner product (the dot product - $\vec{u}.\vec{v}$ ) should be equal to 0, therefore: $$8x+4y-6z=0 \tag{1}$$ Choose for example x,y and find z from equation 1. In order to make its length equal to 1, calculate $\|\vec{v}\|=\sqrt{x^2+y^2+z^2}$ and divide $\vec{v}$ with it. Your unit vector would be: $$\vec{u}=\frac{\vec{v}}{\|\vec{v}\|}$$

$\endgroup$
3
  • 4
    $\begingroup$ "Choose for example x,y .." - cannot both be 0 (zero) $\endgroup$
    – slashmais
    Feb 16, 2017 at 8:23
  • 1
    $\begingroup$ Your recipe fails if the coefficient for $z$ is zero. $\endgroup$
    – Walter
    Mar 29, 2019 at 9:29
  • $\begingroup$ @ walter, then choose only $x$ and find $y$. $\endgroup$
    – Kashmiri
    Jan 14, 2021 at 10:40
29
$\begingroup$

Congrats on 10'000+ views! I'd like to combine the above fine answers into an algorithm.

Given a vector $\vec x$ not identically zero, one way to find $\vec y$ such that $\vec x^T \vec y = 0$ is:

  1. start with $\vec y' = \vec 0$ (all zeros);
  2. find $m$ such that $x_m \neq 0$, and pick any other index $n \neq m$;
  3. set $y'_n = x_m$ and $y'_m = -x_n$, setting potentially two elements of $\vec y'$ non-zero (maybe one if $x_n=0$, doesn't matter);
  4. and finally normalize your vector to unit length: $\vec y = \frac{\vec y'}{\|\vec y'\|}.$

(I'm referring to the $n$th element of a vector $\vec v$ as $v_n$.)

$\endgroup$
1
  • 3
    $\begingroup$ This is the best answer here. $\endgroup$
    – plasmacel
    Feb 8, 2018 at 20:36
27
$\begingroup$

Every answer here gives the equation $8a+4b-6c=0$. None mentions that this equation represents a plane perpendicular to the given vector. I am sure that the omission was an oversight of each respondent. But it deserves mention and emphasis. In the plane perpendicular to any vector, the set of vectors of unit length forms a circle. So answers will vary. The vectors $(-1,2,0)^t$ and $(2,0,3)^t$ can be chosen to be a basis for the solution space of the plane: solve for a, divide by 8, and let $2b$ and $3c$ be independent variables. You can divide each by its length $\sqrt{5}$ and $\sqrt{13}$ respectively, and take a trigonometric combination of them to get a general solution.

$\endgroup$
16
$\begingroup$

An automated procedure:

Take a standard vector $\vec e_k$ which is not parallel to $\vec v$, and form the cross product $\vec e_k\times\vec v$, which is guaranteed to be orthogonal to $\vec v$.

The crux of the method is to take the $\vec e_k$ which is "the less parallel" to $\vec v$, i.e. that minimizes the dot product: take the index $k$ corresponding to the smallest $|v_k|$, and you are on the safe side.


Update:

In $d$ dimensions, take the standard vector $\vec e_k$ that forms the smallest dot product (in absolute value) with $\vec v$ and normalize the vector

$$\vec e_k-\frac{\vec e_k\vec v}{\|v\|^2}\vec v=\vec e_k-\frac{v_k}{\|v\|^2}\vec v.$$

$\endgroup$
4
  • 1
    $\begingroup$ Thank you for thinking outside the box! Of course, any vector not parallel to v will produce a perpendicular when crossed with v. This is actually a better answer than most because it is a direct computation, no equation solving required. $\endgroup$ May 23, 2018 at 3:50
  • 1
    $\begingroup$ This only works for 3D vectors, though. $\endgroup$
    – Walter
    Mar 29, 2019 at 9:52
  • $\begingroup$ Don't you mean smallest dot product for the general d-dimensional case? $\endgroup$
    – sellibitze
    Apr 22, 2019 at 23:53
  • $\begingroup$ @sellibitze: yep, thanks for the notice. Fixing. $\endgroup$
    – user65203
    Apr 23, 2019 at 6:40
8
$\begingroup$

I want to add an answer for only two dimensions since it's much more simple:

If our vector is $$v = ai + bj$$ We can easily calculate the normal of $v$, because the normal of a vector is perpendicular to it. $$n = -bi + aj$$ $n$ is now a perpendicular vector to the vector v, it just has to be normalized, which is explained in other answers already. $$n \rightarrow \frac{n}{\lVert n \rVert}$$

$\endgroup$
2
  • 3
    $\begingroup$ Welcome to MSE. How will your answer help someone who is interested in working with a vector with $3$ non-zero components? $\endgroup$ Sep 13, 2021 at 12:18
  • 6
    $\begingroup$ @JoséCarlosSantos It doesn't, but in the question, the OP doesn't explicitly say he only wants answers for vectors with 3 components, he only gave an example. Since there are many answers already, I wanted to add a simpler answer in case someone is working with vectors with only 2 components. $\endgroup$
    – George
    Sep 13, 2021 at 12:28
7
$\begingroup$

Two steps:

First, find a vector $a\,{\bf i}+b\,{\bf j}+c\,{\bf k}$ that is perpendicular to $8\,{\bf i}+4\,{\bf j}-6\,{\bf k}$. (Set the dot product of the two equal to 0 and solve. You can actually set $a$ and $b$ equal to 1 here, and solve for $c$.)

Then divide that vector by its length to make it a unit vector. This unit vector will still be perpendicular to $8\,{\bf i}+4\,{\bf j}-6\,{\bf k}$ .

$\endgroup$
7
$\begingroup$

A vector $v=ai+bj+ck$ is perpendicular to $w=8i+4j-6k$ if and only if $$v\cdot w=8a+4b-6c=0.$$ So for example, we could choose $a=1,b=1,c=2$, so that $v=i+j+2k$. But this is not a unit vector: $$\|v\|=\sqrt{a^2+b^2+c^2}=\sqrt{1^2+1^2+2^2}=\sqrt{6}.$$ However, for any number $t$, it is the case that $\|tv\|=|t|\cdot\|v\|$, and $(tv)\cdot w=t(v\cdot w)$. This shows us how to modify our vector $v$ to get a unit vector that still retains the property of being perpendicular to $w$. Specifically, $$u=\frac{1}{\sqrt{6}}\cdot v=\left(\frac{1}{\sqrt{6}}\right)i+\left(\frac{1}{\sqrt{6}}\right)j+\left(\frac{2}{\sqrt{6}}\right)k$$ satisfies $$\|u\|=\frac{1}{\sqrt{6}}\|v\|=\frac{1}{\sqrt{6}}\cdot\sqrt{6}=1,$$ so that $u$ is unit vector, and $$u\cdot w=\frac{1}{\sqrt{6}}(v\cdot w)=\frac{1}{\sqrt{6}}\cdot0=0,$$ so that $u$ is perpendicular to $w=8i+4j-6k$.

$\endgroup$
2
$\begingroup$

You are just looking to a vector $(x,y,z)$ s.t. $8x+4y-6z=0$. Take $(1,-2,0)$ for example, and then divide it by its norm to make it unit. Another method is that from any non-colinear vector to the first, you can apply Gramm-Schmidt process to get an orthogonal vector from the second.

$\endgroup$
2
$\begingroup$

THEORY:- Suppose 2 vectors A(given) and B,we need to find vector B such that it is Perpendicular to vector A. We also know that A.B=0 (since angle b/w them is 90° and cos(90°)=0. The below described algorithm can be applied for 2D as well as 3D vectors.

Proof:- Given A (8i+4j-6k) Total 3 steps.

Step 1:- Suppose a vector B (i+j+k).

Step 2:- Now firstly compare and divide the coefficient of each unit vector in B with that of A. As in this case, => B=(1/8)i+(1/4)j+(1/-6)k.

Step 3:- Now multiply any one of the three coefficient of unit vector in B with (-2). As in this case i have multiplied (-2) with the coefficient of j.It can be done with i or k also. ** => B=(1/8)i+(1/4)j+(1/3)k. Now for the Unit Vector we can divide vector B with its magnitude, which would be in this case, => |B|= √(1/8)² +(1/4)² +(1/3)²

**=> Unit (B)=B/|B|

** (B) IS THE VECTOR PERPENDICULAR TO A. ** Unit(B) IS THE REQUIRED UNIT VECTOR. Verification:-This can be verified as A.B=0

Proved. :)

$\endgroup$
3
  • $\begingroup$ Please use MathJax. $\endgroup$ Dec 25, 2015 at 19:36
  • $\begingroup$ @Silvia Ghinassi: i actually am not aware about it,what is it? $\endgroup$ Dec 26, 2015 at 7:21
  • $\begingroup$ @KrishnaMaheshwari can you see well behaved math symbols making post pleasant to read, that is MathJax. Please read more about $\endgroup$
    – jlandercy
    Oct 8, 2017 at 23:14
2
$\begingroup$

In addition to Yves Daoust's answer,

In d dimensions, take any random vector $w$ which is not parallel to $v$, then $$u=w-\frac{v^Tw}{||v||^2}v$$ is orthogonal to the vector $v$. It doesn't have to be a standard vector (or that forms the smallest dot product).

$\endgroup$
-4
$\begingroup$

You need to find a*i + b*j + c* k so that the dot product of it with 8i +4j -6k is 0.

It means 8a + 4b - 6 c = 0.

You need to choose a,b,c satisfy above. For example, you can choose a = 1, b = 1, c = 2.

$\endgroup$
2
  • 2
    $\begingroup$ That does not give a unit vector. $\endgroup$ Apr 17, 2012 at 22:34
  • $\begingroup$ Does not give a unit vector and is a repetition of several previous responses. $\endgroup$ May 23, 2018 at 3:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .