# 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}}$

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

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

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

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.