12.07.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.2sage: from sage.matrix.constructor import ith_to_zero_rotation_matrixsage: v = vector((1,2,3))sage: ith_to_zero_rotation_matrix(v, 2)[ 1 0 0][ 0 2/13*sqrt(13) 3/13*sqrt(13)][ 0 -3/13*sqrt(13) 2/13*sqrt(13)]sage: ith_to_zero_rotation_matrix(v, 2) * v(1, sqrt(13), 0)sage: ith_to_zero_rotation_matrix(v, 0)[ 3/10*sqrt(10) 0 -1/10*sqrt(10)][ 0 1 0][ 1/10*sqrt(10) 0 3/10*sqrt(10)]sage: ith_to_zero_rotation_matrix(v, 1)[ 1/5*sqrt(5) 2/5*sqrt(5) 0][-2/5*sqrt(5) 1/5*sqrt(5) 0][ 0 0 1]sage: ith_to_zero_rotation_matrix(v, 2)[ 1 0 0][ 0 2/13*sqrt(13) 3/13*sqrt(13)][ 0 -3/13*sqrt(13) 2/13*sqrt(13)]sage: ith_to_zero_rotation_matrix(v, 0) * v(0, 2, sqrt(10))sage: ith_to_zero_rotation_matrix(v, 1) * v(sqrt(5), 0, 3)sage: ith_to_zero_rotation_matrix(v, 2) * v(1, sqrt(13), 0)Other ring:sage: ith_to_zero_rotation_matrix(v, 2, ring=RR)[ 1.00000000000000 0.000000000000000 0.000000000000000][ 0.000000000000000 0.554700196225229 0.832050294337844][ 0.000000000000000 -0.832050294337844 0.554700196225229]sage: ith_to_zero_rotation_matrix(v, 2, ring=RDF)[ 1.0 0.0 0.0][ 0.0 0.554700196225 0.832050294338][ 0.0 -0.832050294338 0.554700196225]On the symbolic ring:sage: x,y,z = var(’x,y,z’)sage: v = vector((x,y,z))sage: ith_to_zero_rotation_matrix(v, 2)[ 1 0 0][ 0 y/sqrt(y^2 + z^2) z/sqrt(y^2 + z^2)][ 0 -z/sqrt(y^2 + z^2) y/sqrt(y^2 + z^2)]sage: ith_to_zero_rotation_matrix(v, 2) * v(x, y^2/sqrt(y^2 + z^2) + z^2/sqrt(y^2 + z^2), 0)TESTS:sage: ith_to_zero_rotation_matrix((1,0,0), 0)[ 0 0 -1][ 0 1 0][ 1 0 0]sage: ith_to_zero_rotation_matrix((1,0,0), 1)[1 0 0]37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!