2
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ How about finding a basis containing that vector, extending the basis to a basis for the space, and then applying Gram-Schmidt to get an orthonormal basis? $\endgroup$
    – user99680
    Dec 26 '13 at 6:43
2
$\begingroup$

Maybe this will help: How about finding a basis containing that vector, extending the basis to a basis for the space, and then applying Gram-Schmidt to get an orthonormal basis?

One way to do this is by using the fundamental theorem of linear algebra: http://en.wikipedia.org/wiki/Fundamental_theorem_of_linear_algebra . Using the 4d-vector as the first row of a $4 \times 4$ matrix $M$ , then finding the nullspace of that matrix, since ker$M$ =orthogonal complement of the row space. This will extend the 4d-vector into a basis for $\mathbb R^4$

Then you can apply Gram-Schmidt algorithm will give you three vectors orthogonal to the original vector.

$\endgroup$
0
$\begingroup$

Two vectors are perpendicular if and only if their dot product is zero.

$\endgroup$
3
  • 1
    $\begingroup$ Great job! We should assume the OP doesn't know the definition of perpendicular $\endgroup$
    – Squirtle
    Dec 26 '13 at 6:46
  • 2
    $\begingroup$ @Squirtle The OP knows words like rotation and cross product. I find it highly unlikely that he doesn't know the word perpendicular. $\endgroup$ Dec 26 '13 at 7:15
  • 1
    $\begingroup$ I can see someone^ doesn't understand sarcasm... just in case, your comment was PRECISELY my point. $\endgroup$
    – Squirtle
    Dec 26 '13 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.