Ask Your Question
0

finding rotation matrix in 3d

asked 2012-06-18 20:14:29 -0500

ebs gravatar image

updated 2012-06-18 20:15:28 -0500

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 flag offensive close merge delete

Comments

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

benjaminfjones gravatar imagebenjaminfjones ( 2012-06-19 06:29:31 -0500 )edit

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

ndomes gravatar imagendomes ( 2012-06-19 10:36:50 -0500 )edit

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

ebs gravatar imageebs ( 2012-06-21 00:13:50 -0500 )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.

benjaminfjones gravatar imagebenjaminfjones ( 2012-06-21 05:20:36 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2017-03-02 16:34:24 -0500

Sébastien gravatar image

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.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 414 times

Last updated: Mar 02