For a program I'm writing, I need to find the vectors orthogonal to a given vector rotated at an arbitrary angle, and in 4D. It is a unit vector.
For 3D, I found the two orthogonal vectors like this:
I would find the first orthogonal vector by taking the spherical coordinates of the original vector, adding $\frac{\pi}{2}$ to $\phi$, and calculating the resulting vector's rectangular coordinates.
To find the third and final orthogonal vector in 3D, I take the cross product of the orthogonal vector and the original vector.
I want to implement a version of this in 4D. However, I can't easily visualize this happening, and I understand little about vectors as it is. I believe I need to find two orthogonal vectors through the method of adding $\frac{\pi}{2}$ to the correct spherical coordinate, giving me 3 orthogonal vectors. I can then take the cross product of these three vectors. I have been completely unable to even start on this. Is there a better way, or can I just not see it?
If it helps, I'm using these vectors to "rotate" coplanar 3D and 4D points to align along an axis, removing one of the dimensions needed to render the full shape. Essentially, I'm trying to render the cross section of higher-dimensional solids.
Two vectors are perpendicular if and only if their dot product is zero.