Disclaimer: I know very little about vectors, but think I know trig fairly well. My calculus is very limited so far, so I would appreciate a solid explanation.
I am trying to draw a spiral around a vector with given amplitude, frequency, shifting, whatever. I am fairly confident with trig, so I could do this no problem in 2 dimensions. In 3 dimensions, I am having some trouble.
After some work drawing this out on paper, I believe I can draw this spiral if I have 2 perpendicular vectors looking like this: 3d plane Where y is the vector I want to draw a spiral around and x and z are the perpendicular vectors. If I can get this vectors, I should be able to use the magnitude of the vectors to make the spiral.
My issue is that I don't know how to get the x and z vectors. My research online has led me to dot product, which allows me to figure out if 2 vectors are perpendicular or parallel, which should help me.
Note: I am not trying to get the x or z axis. I want to get x and z in relation to y, which may be "pointing" anywhere.
So my question: How can I find these 2 perpendicular vectors
Approach 1.
Suppose you have your vector $y = (y_1, y_2, y_3)$. A vector $x$ is perpendicular to it if $$x_1 y_1 + x_2 y_2 + x_3 y_3 = 0.$$ Pick some $x$ that satisfies this equation. (You could pick some arbitrary $x_1$ and $x_2$, and then choose $x_3$ to make sure the equation is satisfied.)
Next, you want $z$ to be perpendicular to both $x$ and $y$, so you need it to satisfy \begin{align} z_1 x_1 + z_2 x_2 + z_3 x_3 &= 0 \\ z_1 y_1 + z_2 y_2 + z_3 y_3 &= 0 \end{align} (You could pick some arbitrary $z_1$, and then solve the two equations for the two unknowns $z_2$ and $z_3$.)
Approach 2. More generally, the Gram-Schmidt process can be used to produce an orthonormal basis. If you start with some vector $y$, then the result is an orthonormal basis that includes $y$.