Given a vector $a\vec{i}+b\vec{j}+c\vec{k}$, how do you find all vectors perpendicular to it in a parametrised form preferably? One can of course say $x,y,z\,\,such \,that \,ax+by+cz=0$. I am looking for a very succinct parametrisation, as minimum parametrising variables as possible. We already know that all such vectors will lie on circle.So there should be some very easy parametrisation that does not have to iterate through $x,y,z$. Actually i want to write a computer code, and iterating through all possible $x,y,z$ just won't cut it. Any smart way of representing all vectors?
-
$\begingroup$ You can represent these vectors as $\lambda Ov$, where $\lambda\in \mathbb{R}$, $O\in SO(3)$ is a rotation matrix fixing your given vector, and $v$ some non-zero vector perpendicular to your original vector. Basically parametrizing through rotations $SO(2)\cong S^1$. Is this something you want? $\endgroup$– QidiJun 16, 2015 at 15:02
-
1$\begingroup$ On second thought an easier way may be just find $2$ perpendicular vectors $e_1$ and $e_2$, then consider $(\lambda_1 , \lambda_2 ) \to \lambda_1 e_1 + \lambda_2 e_2$ $\endgroup$– QidiJun 16, 2015 at 15:11
-
$\begingroup$ @DietrichBurde no they are plain vectors, just 3D space. I made the correction. $\endgroup$– user_1_1_1Jun 16, 2015 at 15:42
-
$\begingroup$ @Qidi I think what you say makes a lot of sense, but can you elaborate in detail what you mean. I could not understand fully. Maybe you could write the answer describing both approaches like how will you find $e_1,e_2$ in first place, etc. $\endgroup$– user_1_1_1Jun 16, 2015 at 15:43
4 Answers
To simplify matters lets call $e_1 = (a,b,c)$ in your chosen basis. You can extend $\{e_1 \}$ to an orthogonal basis $\{e_1, e_2, e_3\}$ using Gram-Schmidt. You can google Gram-Schmidt algorithm if you don't already know it. Then $span\{e_2 ,e_3\}$ is the plane orthogonal to $e_1$, and any element in that plane is a linear combination of $e_2$ and $e_3$, i.e. $\lambda_2 e_2 + \lambda_3 e_3$.
If you only want those vectors with unit length(forming a circle), you could also parameterize it by $$ \sin{\theta} e_2 + \cos{\theta}e_3 $$ so that $\sin{\theta} ^2 + \cos{\theta}^2 =1$
Of course you need to normalize $\{e_1, e_2, e_3\}$ into an orthonormal basis first.
I would say the first approach is more complicated to write down but easier to think of in an abstract way. You simply write a $2$-$d$ rotational matrix in the basis $\{e_2 ,e_3\}$ and act on any orthogonal non-zero vector, e.g. $e_2$. To implement this simply find the matrix sending the standard basis to $\{e_1,e_2,e_3\}$ and conjugate a $2$-$d$ rotational matrix with it. You will basically get the same thing.
-
1$\begingroup$ Based on my reading, i understand that i have to take a matrix $A=[e_1;v_2;v_3]$ where $v_2,v_3$ are randomly generated and then run GS on it, is it? $\endgroup$ Jun 16, 2015 at 20:40
You would need two parameters to do this, for example $$x=\frac {\mu}{a}$$ $$y=\frac {\lambda-\mu}{b}$$ $$z=-\frac {\lambda}{c}$$
-
$\begingroup$ How do you find $\mu,\lambda$ given $a,b,c$? $\endgroup$ Jun 16, 2015 at 15:45
-
-
$\begingroup$ @GoCodes: you have to choose i.e. assign any values $\lambda,\mu\in \mathbb R$ $\endgroup$ Jun 16, 2015 at 18:11
Let $U=(b,-a,0)$ and $V=(ac,bc,-a^2-b^2)$. With the given vector $(a,b,c)$, they form an orthogonal basis.
Then use $$U\cos(\theta)+V\sin(\theta),$$with $0\le\theta<2\pi$.
If you normalize the two vectors, their combination will follow a circle instead of an ellipse.
To stay away from the degenerate case $a=b=0$, permute the components so that the largest two appear in $U$.
-
$\begingroup$ Where do your definitions of U and V come from? $\endgroup$ Jan 23, 2020 at 20:04
-
$\begingroup$ @JosephGarvin: cross products to obtain orthogonal vectors. $\endgroup$– user65203Jan 23, 2020 at 20:11
Let $\vec{w}$ be a such a vector and $\vec v = a\vec i + b\vec j + c\vec k$ $$\vec w \cdot \vec v = 0$$
The set of all such $\vec w$ forms a plane.