|Apr8-12, 06:32 AM||#1|
Decompose rotations of a vector
I'm programming a class in C++ that generates a circular signal. The signal consists of a sin and cos in perpendicular directions.
The user has to input the norm to the surface, and the program generates the sine and cosine in 2 perpendicular directions to that norm to generate the circular signal.
The question is the following. If the user provided this vector, how can I find those 2 perpendicular vectors?
I think this problem can be reduced to finding the Euler angles that rotated this vector from being parallel to the z plane. So that the cosine remains on the x-axis, and the sine on the y-axis. Is it possible to decompose it that way?
|Apr8-12, 07:20 AM||#2|
If you have the vector that is normal to the surface, then you can define the plane using n . (r - r0) = 0 where n is the normal and r0 is a point on the plane. Now to get the orthornomal basis (the two perpendicular vectors with respect to the supplied one) you have to solve the equation n . a = 0 for some a. Just choose the x and y components of a randomly and then solve for the z component of a. Normalize a to a unit vector.
After this you take the cross product of n and a to get a vector b and then take the cross product of n and b to get c. Normalize c and b and your perpendicular orthogonal unit vectors to n are the normalized c and b vectors and that completes your orthonormalization.
|Apr8-12, 07:58 AM||#3|
Thanks a lot, man :-)
|Similar Threads for: Decompose rotations of a vector|
|When can I decompose a random variable $Y=X'-X''$?||Set Theory, Logic, Probability, Statistics||4|
|Boost generator transforms as vector under rotations||Quantum Physics||4|
|decompose to water and oxygen||Biology, Chemistry & Other Homework||1|
|Decompose||Precalculus Mathematics Homework||2|