习题2答案习题2.写出完成如下平面图形变换的变换矩阵;(1)保持点(5,10)固定,x方向放大3倍,y方向放大2倍。(2)绕坐标原点顺时针旋转90。(3)对直线xy成轴对称。(4)对直线xy成轴对称。(5)沿与水平方向成角的方向扩大1S倍,沿与水平方向成90角的方向扩大2S倍。(6)对于平面上任意一点),(00yx成为中心对称。(7)对平面上任意一条方程为0CByAx的直线成轴对称。解答:(1)变换矩阵如下:11010020003)10,5()2,3()10,5(TST(2)变换矩阵如下:1000010101000)90cos()90sin(0)90sin()90cos()90(R(3)变换矩阵如下:10000101010002222022221000100011000222202222)45()1,1()45(RSR(4)变换矩阵如下:10000101010002222022221000100011000222202222)45()1,1()45(RSR(5)变换矩阵如下:1000cossinsincos)(0sincos)(sincos1000)cos()sin(0)sin()cos(10000001000)cos()sin(0)sin()cos()(),()(2221212122212121SSSSSSSSSSRSSSR(6)变换矩阵如下:12201000110100011000100011010001),()1,1(),(0000000000yxyxyxyxTSyxT(7)变换矩阵如下:对平面上任意一条方程为0CByAx的直线成轴对称当0A时,122020210010001100001000100011000010010001)0,())(()1,1())(()0,(22222222222222222222222222222222BABCBAACBABABAABBAABBAABACBAABABBABBAABAABABBABBAAACACTABarctgRSABarctgRACT或者当0B时,122020210010001100001000100011000010010001),0())(()1,1())((),0(22222222222222222222222222222222BABCBAACBABABAABBAABBAABBCBABBAABAABABBABBAABAABABBCBCTBAarctgRSBAarctgRBCT习题5答案习题5.举例说明由平移、比例或旋转构成的组合变换一般不能交换变换的次序,说明什么情况下可以交换次序。平移与比例不能交换变换的次序解答:平移与比例不能交换变换的次序,如下:1000010100011000000),(),(1000010000001010001),(),(yxyxyxyxyxyxyyxxyxyxyxyxyxTTSSTTSSTTTSSSSTSTSSSSTTSSSTTT平移与旋转不能交换变换的次序,如下:10cossin0sincos10100011000cossin0sincos),()(1cossinsincos0cossin0sincos1000cossin0sincos1010001)(),(yxyxyxyxyxyxyxTTTTTTTRTTTTTTRTTT当xySS时,比例与旋转不能交换变换的次序,而当xySS时,比例与旋转可以交换变换的次序,如下:1000cossin0sincos10000001000cossin0sincos),()(1000cossin0sincos1000cossin0sincos1000000)(),(yxyxyxyxyyxxyxyxSSSSSSSSSRSSSSSSRSSS即如果组合变换由一系列比例和旋转变换组成,并且比例变换中xySS,则可以交换变换次序。习题7答案习题7.平面上两点P和V的齐次坐标是(321,,ppp)和(321,,vvv),验证过这两点的直线采用齐次坐标的方程是:0)()()(312212312312332xpvpvxpvpvxpvpv解答:P和V两点的齐次坐标规范化得:)1,,(3231pppp,)1,,(3231vvvv设直线过P,V两点的直线上的任意一点的齐次坐标为),,(321xxx,则它的规范化结果为)1,,(3231xxxx可得过P,V两点的直线方程为:3131323231313232ppvvppvvppxxppxx))(())((3232313131313232ppvvppxxppvvppxx))(())((2332133113312332pvpvpxpxpvpvpxpx23132331321332311323133231233132pvpxpvpxpvpxpvpxpvpxpvpxpvpxpvpx)()()()(322313233231311323133132pvpvpxpvpvpxpvpvpxpvpvpx0)()()()(311323322313133132233231pvpvpxpvpvpxpvpvpxpvpvpx0)()()(3121323212313311332233231pvppvppvppvpxpvpvpxpvpvpx0)()()(21313212323133113223321pvppvppvppvpxpvpvxpvpvx0)()()(122133113223321pvpvxpvpvxpvpvx得到过P,V两点的采用齐次坐标的方程为0)()()(312212311312332xpvpvxpvpvxpvpv证明完毕习题12答案习题12.若已知某一正方形显示器的坐标范围是以dxmin、dxmax、dymin和dymax规定的矩形区,且(dymax–dymin)=3/4(dxmax-dxmin),为保证图形不失真并充分利用显示区,请写出自用户坐标至该显示器坐标的视见变换矩阵。解答:设用户坐标区的坐标范围是以wxmin、wxmax、wymin和wymax规定的矩形区域。为保证图形在此显示器上显示不失真,其视见变换矩阵如下:13400003410100011000000341010001),(),34(),(minminminminminminminminminminminmin21kwydykwxdxkkdydxkkwywxdydxTkkSwywxTTSTHk如下确定:设minmaxminmaxwxwxdxdxkx,minmaxminmaxwywydydyky,),min(yxkkk(1)若43minmaxminmaxwxwxwywy,因为有43minmaxminmaxdxdxdydy,所以有minmaxminmaxminmaxminmaxdxdxdydywxwxwywy,所以有xykk,则minmaxminmaxwywydydyk;(2)若43minmaxminmaxwxwxwywy,即xykk,则minmaxminmaxwxwxdxdxk习题15答案习题15.给出三维空间中通过原点和点),,(111zyx的一条直线,试用下面提示的三种不同方法把这条直线旋转到正的z轴上,说明求出的三个变换矩阵可能不同,但就完成要求表换得效果看是相同的。(1)绕x轴旋转到xz平面,然后绕y轴旋转到z轴;(2)绕y轴旋转到yz平面,然后绕x轴旋转到z轴;(3)绕z轴旋转到xz平面,然后绕y轴旋转到z轴。解答:(1)绕x轴旋转到xz平面,然后绕y轴旋转到z轴10000000100000001000100000000001111111111111111uzvyuvzxuyvzuvyxuxuvuvuxuxuvvzvyvyvz)1,,0,0()1,,0,()1,,,(/sin,/cos,/sin,/cos,11111112121212121uvxzyxuxuvvyvzzyxuzyv(2)绕y轴旋转到yz平面,然后绕x轴旋转到z轴xzyαβ(x1,y1,z1)(x1,0,v)O10000000100000000001100001010010010111111111111uzuvzyvxuyuvuxuvyxvzuvuyuyuvvzvxvxvz)1,,0,0()1,,,0()1,,,(/sin,/cos,/sin,/cos,11111112121212121uvyzyxuyuvvxvzzyxuzxv(3)绕z轴旋转到xz平面,然后绕y轴旋转到z轴10000000100000001000100001000011001111111111111uzuvuyvxuvzyuxvyuvzxuzuvuvuzvxvyvyvx)1,,0,0()1,,0,()1,,,(/sin,/cos,/sin,/cos,11111112121212121uzvzyxuvuzvyvxzyxuyxvxzyαβ(x1,y1,z1)(0,y1,v)O通过上面可知,虽然三个变换矩阵不同,但是)1,,,(111zyx都变换成)1,,0,0(u,所以效果是相同的。xzyαβ(x1,y1,z1)(v,0,z1)O习题17答案习题17.