57
$\begingroup$

How do I find a vector perpendicular to a vector like this: $3\mathbf{i}+4\mathbf{j}-2\mathbf{k}?$ Could anyone explain this to me, please?

I have a solution to this when I have $3\mathbf{i}+4\mathbf{j}$, but could not solve if I have $3$ components...

When I googled, I saw the direct solution but did not find a process or method to follow. Kindly let me know the way to do it. Thanks.

  • 4
    There are a lot of detailed mathy answers here, but the most practical answer is found only in the comment from @Did above. Just make sure that the two components you switch are not both zero. I lack the reputation to add an answer, but here's a complete and simple solution in C form: planeVec = (normal.x == normal.y ? new Vector3(-normal.z, 0, normal.x) : new Vector3(-normal.y, normal.x, 0))2017-01-03

13 Answers 13

49

There exists an infinite number of vectors in 3 dimension that are perpendicular to a fixed one. They should only satisfy the following formula: $(3\mathbf{i}+4\mathbf{j}-2\mathbf{k}) \cdot v=0$

For finding all of them, just choose 2 perpendicular vectors, like $v_1=(4\mathbf{i}-3\mathbf{j})$ and $v_2=(2\mathbf{i}+3\mathbf{k})$ and any linear combination of them is also perpendicular to the original vector: $v=((4a+2b)\mathbf{i}-3a\mathbf{j}+3b\mathbf{k}) \hspace{10 mm} a,b \in \mathbb{R}$

  • 0
    This is just a suggestion for an addition to the answer at the very end: "All the vectors perpendicular to 3i+4j−2k form a plane in 3D space. This plane would represent the null-space of your vector".2018-11-25
24

Take cross product with any vector. You will get one such vector.

  • 19
    unless that other vector is parallel to the original vector, in which case you will get $(0,0,0)$2015-08-07
8

You just need to find any vector $v \neq 0$ such that $v \cdot (3\mathbf{i}+4\mathbf{j}-2\mathbf{k}) = 0$.

There is no unique solution, any one will do. To save typing, let $p = 3\mathbf{i}+4\mathbf{j}-2\mathbf{k}$.

Pick a vector $x$, that is not on the line through the origin and $p$. Take $x = 3\mathbf{i}$, for example.

Construct a vector perpendicular to $p$ in the following way: Find a value of $t$ so that $(x+t p) \cdot p = 0$. Then the vector $v=x+t p$ will be perpendicular to $p$.

In my example, $(x+t p) = (3 + 3 t)\mathbf{i}+4 t \mathbf{j}-2t\mathbf{k}$, and $(x+t p) \cdot p = 9 + 29 t$. By choosing $t=-\frac{9}{29}$, the vector $v=x+t p$ is now perpendicular to $p$.

7

A related problem is to construct an algorithm that finds a non-zero perpendicular vector without branching. If the input vector is N = (a,b,c), then you could always choose T = (c,c,-a-b) but T will be zero if N=(-1,1,0). You could always check to see if T is zero, and then choose T = (-b-c,a,a) if it is, but this requires a test and branch. I can't see how to do this without the test and branch.

4

A suggested solution without a branch could be: Construct an array of 2 vector elements in the following way:

arr[0] = (c,c,-a-b) arr[1] = (-b-c, a,a) int selectIndex = ((c != 0) && (-a != b)) // this is not a branch perpendicularVector = arr[selectIndex] 

If (c, c, -a-b) is zero, selectIndex is 1 and the other vector will be selected.

  • 0
    @Stuntddude The sarcasm is utterly unnecessary, but thanks for pointing it out. My first comment is still correct; please fix that when you get a chance.2018-08-05
1

Definition of the Dot Product:

$\vec{a} \cdot \vec{b}$ = ( $a_{1} , a_{2}$ ) $\cdot$ ( $b_{1} , b_{2}$ ) = $a_{1}b_{1} + a_{2}b_{2}$

also known as the scalar product or inner product

$\mathbf{\vec{a} \cdot \vec{b}}$ is a one "number" answer

Orthogonal Vectors:

Two vectors are orthogonal (perpendicular) if and only if $\ \mathbf{\vec{a} \cdot \vec{b} = 0}$ in other words... two vectors are perpendicular if their DOT PRODUCT is ZERO

Example:

Let

$\vec{a}$ = ( 8 , -4 )

that is:

$a_{1}$ = 8

$a_{2}$ = -4

Find a vector $\mathbf{\vec{r}}$ that is perpendicular to $\mathbf{\vec{a}}$:

$\vec{r}$ = (x, y);

that is:

$b_{1} = x$

$b_{2} = y$

$\vec{a} \cdot \vec{r} = 8x + (-4y) = 0 \Rightarrow$

$\Rightarrow 8x - 4y = 0 \Rightarrow$

$8(1) - 4(2) = 0 \Rightarrow \mathbf{\vec{r} = (1, 2)} \Rightarrow$ one solution

$8(2) - 4(4) = 0 \Rightarrow \mathbf{\vec{r} = (2, 4)} \Rightarrow$ other solution

$8(-1) - 4(-2) = 0 \Rightarrow \mathbf{\vec{r} = (-1, -2)} \Rightarrow$ other solution

... as Rebecca said: << Keep in mind there will be an infinite number of perpendicular vectors >> ... Here the pdf source

  • 0
    This is not an answer to the question. Question-asker states that he knows how to solve in 2D (two axes or components), but doesn't understand how to solve in 3D. You are showing the solution to 2D. Similarly, you misunderstand Rebecca's comment about there being an infinite number of perpendicular vectors. All your solution vectors are in the same **direction**, only varying by length. Indeed, this is what happens in 2D. However, Rebecca is talking about 3D, in which the DIRECTIONS of the solutions also vary.2017-04-30
1

A vector perpendicular to the given vector A can be rotated about this line to find all positions of the vector. To find them,

if $ A \cdot B =0 $ and $ A \cdot C =0 $ then $ B,C $ lie in a plane perpendicular A and also $ A \times ( B \times C ) $= 0, for any two vectors perpendicular to A. (Last equation typo edited late)

1

A geometric solution would be as follows. The plane $3x+4y-2z=0$ is perpendicular to the vector $3i+4j−2k$. Any vector in that plane is thus perpendicular this vector. Thus you may choose any $x$, $y$ and $z$ that lie in the plane $3x+4y-2z=0$ and the resulting $xi+yj+zk$ will be perpendicular to $3i+4j−2k$,

0

The dot product of two perpendicular vectors are always $0$ so if you $(ai+bj+ck)\cdot(di+ej+fk)=0$ you can solve for the different variables. If you have one vector than the infinite amount of perpendicular vectors will form a plane that is perpendicular to the original vector. If you know one or two of the coordinates of the desired perpendicular line than you can find the corresponding vector(s) on that plane.

0

Remember: There exist infinite vector in 3 dimension that are perpendicular to a fixed one. Now, Let $v\neq 0$ be the vector whose is $xi+yj+zk$. So , $v$ is perpendicular to the vector $3i+4j-2k$. Therefore, $v\cdot\langle 3i+4j−2k\rangle=0$. $ \langle xi+yj+zk\rangle\cdot \langle3i+4j−2k\rangle =0 $ so $3x+4y-2z=0$ (1) where $i\cdot i =j\cdot j=k\cdot k=1$.

Now, there are three unknown variable such x, y and z in (1). You can choose any two variable whatever you like. Let $y=2$ and $z=1$,
then $x=-2$ from (1),

One of the vector is $(-2i+2j+k)$. Similarly, you can choose one of two variables from (1) , then find the third variable. So, you can find infinite perpendicular vectors to the vector $3i+4j-2k$.

0

All vectors perpendicular to the given vector form a plane. If $v_1$ and $v_2$ are perpendicular to the given vector $v = 3i +4j -2k$, then the dot products $v\cdot v_1 =0$ and $v\cdot v_2 = 0$. If $v_1 = 2i -j + k$ and $v_2 = 2i +j +5k$, then a plane formed by any vector $v_3 = av_1 +bv_2$; where $a$ and $b$ are scalars, will be normal to the given vector $v$.

0

Given $n-1$ linearly independent vectors, $\{v_j\}_{j=1}^{n-1}$ in $\mathbb{R}^n$, we can find a non-zero vector, $u$, perpendicular to all of them.

If we set $ \begin{align} u_1&=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&1\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&0\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&0 \end{bmatrix}\\ u_2&=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&0\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&1\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&0 \end{bmatrix}\\ &\vdots\\ u_n&=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&0\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&0\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&1 \end{bmatrix}\\ \end{align} $ then $ u\cdot w=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&w_1\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&w_2\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&w_n \end{bmatrix} $ If we replace $w$ by any of the $v_j$, the determinant will be $0$ because of duplicate columns; thus, $u\cdot v_j=0$.

$\{v_j\}_{j=1}^{n-1}$ cannot span $\mathbb{R}^n$, so there must be some $v_n$ that is not in the span of $\{v_j\}_{j=1}^{n-1}$. This means that $\{v_j\}_{j=1}^n$ are independent, and so $ \begin{align} u\cdot v_n&=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&v_{n,1}\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&v_{n,2}\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&v_{n,n} \end{bmatrix}\\ &\ne0 \end{align} $ In particular, $u\ne0$.

0

One way to do this is to express the vector in terms of a spherical coordinate system. For example

$ \boldsymbol{e}= \pmatrix{a \\ b \\ c} = r \pmatrix{ \cos\varphi \cos\psi \\ \sin\varphi \cos\psi \\ \sin\psi} $

where $r=\sqrt{a^2+b^2+c^2}$, $\tan(\varphi) = \frac{b}{a}$ and $\tan{\psi} = \frac{c}{\sqrt{a^2+b^2}}.$

A choice of two orthogonal vectors can be found with $ \begin{aligned} \boldsymbol{n}_1 & = \frac{{\rm d} \boldsymbol{e}}{{\rm d} \varphi} = r\pmatrix{-\sin \varphi \cos\psi \\ \cos\varphi \cos\psi \\ 0}& \boldsymbol{n}_2 & = \frac{{\rm d} \boldsymbol{e}}{{\rm d} \psi} = r\pmatrix{-\cos\varphi \sin\psi \\ -\sin\varphi \sin\psi \\ \cos\psi} \end{aligned}$

Of course any non-zero linear combination of these two vectors is also orthogonal

$ \boldsymbol{n} = \cos(t) \boldsymbol{n}_1 + \sin(t) \boldsymbol{n}_2 $

where $t$ is an rotation angle about the vector $\boldsymbol{e}$.

Put it all together to make a family of orthogonal vectors in terms of $t$ as

$ \boldsymbol{n} = \pmatrix{-b \cos(t) - \frac{a c}{\sqrt{a^2+b^2}} \sin(t) \\ a \cos(t) - \frac{b c}{\sqrt{a^2+b^2}} \sin(t) \\ \sqrt{a^2+b^2} \sin(t)} $

For $\boldsymbol{e} = \pmatrix{3 & 4 & -2}$ the aboves gives

$ \boldsymbol{n} = \pmatrix{ \frac{6}{4} \sin(t)-4 \cos(t) \\ 3 \cos(t) - \frac{8}{5} \sin(t) \\ 5 \sin(t) } \longrightarrow \begin{cases} \boldsymbol{n} = \pmatrix{-4 & 3 & 0} & t =0 \\ \boldsymbol{n} =\pmatrix{\frac{6}{5} & \frac{8}{5} & 5} & t = \frac{\pi}{2} \end{cases} $

  • 0
    I leave it to the reader to check that $\boldsymbol{n} \cdot \boldsymbol{e} = 0$ and thus the two vectors are orthogonal.2018-03-01