Ask Your Question

# finding rotation matrix in 3d

suppose I have a normalized vector perpendicular to a plane like

$x = \frac{(2i+3j+k)}{\sqrt{14}}$ , how can I find a rotation matrix A, such that it rotates x into the xy plane like so:

$Ax = y = \frac{(i, j)} {\sqrt{2}}$

edit retag close merge delete

## Comments

This is a linear algebra question, not a question about Sage. Try asking on http://math.stackexchange.com/

( 2012-06-19 06:29:31 -0600 )edit

Look at http://www.hr.shuttle.de:9000/home/pub/105/ There is an example.

( 2012-06-19 10:36:50 -0600 )edit

why did you rotate the vector around z axis? can't we rotate it around x and y axes instead?

( 2012-06-21 00:13:50 -0600 )edit

Your original question doesn't have a unique answer. There are infinitely many rotations that take your vector x to a vector in the XY-plane.

( 2012-06-21 05:20:36 -0600 )edit

## 1 answer

Sort by » oldest newest most voted

According to documentation matrix.ith_to_zero_rotation return a rotation matrix that sends the i-th coordinates of the vector v to zero by doing a rotation with the (i-1)-th coordinate :

sage: v = vector((2,3,1))/sqrt(14)
sage: matrix.ith_to_zero_rotation(v, 2)
[                       1                        0                        0]
[                       0  3/10*sqrt(14)*sqrt(5/7)  1/10*sqrt(14)*sqrt(5/7)]
[                       0 -1/10*sqrt(14)*sqrt(5/7)  3/10*sqrt(14)*sqrt(5/7)]
sage: matrix.ith_to_zero_rotation(v, 2) * v
(1/7*sqrt(14), sqrt(5/7), 0)

See also matrix.vector_on_axis_rotation.

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2012-06-18 20:14:29 -0600

Seen: 440 times

Last updated: Mar 02