Ch-6-Prob-10-Old-이승진

1895 days ago by matrix

var('t') # Declare a variable var('x0') # Declare variable var('y0') # Declare variable A=matrix(3,3,[1, 0, x0, 0, 1, y0, 0, 0, 1]); B=matrix(3,3,[cos(t), -sin(t), 0, sin(t), cos(t), 0, 0, 0, 1]); C=matrix(3,3,[1, 0, -x0, 0, 1, -y0, 0, 0, 1]); D=A*B*C # R(theta) var('x') var('y') E=matrix(3,1,[x, y, 1]); F=D*E print F 
       
[x*cos(t) - x0*cos(t) - y*sin(t) + y0*sin(t) + x0]
[x*sin(t) - x0*sin(t) + y*cos(t) - y0*cos(t) + y0]
[                                               1]
[x*cos(t) - x0*cos(t) - y*sin(t) + y0*sin(t) + x0]
[x*sin(t) - x0*sin(t) + y*cos(t) - y0*cos(t) + y0]
[                                               1]