n[{a_,b_,c_,d_}] := a^2+b^2+c^2+d^2; x[{a_,b_,c_,d_},{e_,f_,g_,h_}] := {a e-b f-c g-d h,+b e+a f-d g+c h, +c e+a g+d f-b h,+b g-c f+d e+a h}; conj[{a_,b_,c_,d_}]:= {a,-b,-c,-d}; inv[{a_,b_,c_,d_}] := 1/n[{a,b,c,d}]*conj[{a,b,c,d}]; p[{a_,b_,c_,d_}] := Sqrt[n[{a,b,c,d}]]/Sqrt[b^2+c^2+d^2] {b,c,d}; t = { 10,1,1,1}; w[r_] := {0, Sin[10 r], Cos[10 r] , 2 r }; r[{a_,b_,c_,d_},{t_,xx_,y_,z_}] := x[x[{a,b,c,d},{t,xx,y,z}],inv[{a,b,c,d}]]; (* Equation of the plane perpendicular to (a,b,c,d) containing the (t,x,y,z).*) check[{a_,b_,c_,d_},{x_,y_,z_}] := ( q1 = {x,y,z}; rhs = b x + c y + d z; (* Find piercing point *) t = rhs / (b^2 + c^2 + d^2); p0 = {t b, t c, t d}; q2 = p[r[{a,b,c,d},{0,x,y,z}]]; costheta = (q1-p0).(q2-p0)/ (Sqrt[(q1-p0).(q1-p0)] Sqrt[(q2-p0).(q2-p0)]); theta = ArcCos[costheta]); f[tt_,{xx_,yy_,zz_}] := p[x[x[ tt ,{ 0,xx,yy,zz}],inv[tt]]]; look[t_] := Graphics3D[ {Line[{ { 0, 0, 0}, f[t,{ 4, 4, 4}], f[t,{ 3.5, 3.5, 3.5}], f[t,{ 3.5, 3.6, 3.5}], f[t,{ 4, 4, 4}] , f[t,{ 3.5, 3.5, 3.5}], { 0, 0, 0} } ] } ]; rook[t_] := Graphics3D[ {RGBColor[1,0,0],Line[{ { 0, 0, 0}, f[t,{ 4, 4, 4}], f[t,{ 3.5, 3.5, 3.5}], f[t,{ 3.5, 3.6, 3.5}], f[t,{ 4, 4, 4}] , f[t,{ 3.5, 3.5, 3.5}], { 0, 0, 0} } ] } ]; gook[t_] := Graphics3D[ {RGBColor[0,1,0],Line[{ { 0, 0, 0}, f[t,{ 4, 4, 4}], f[t,{ 3.5, 3.5, 3.5}], f[t,{ 3.5, 3.6, 3.5}], f[t,{ 4, 4, 4}] , f[t,{ 3.5, 3.5, 3.5}], { 0, 0, 0} } ] } ]; book[t_] := Graphics3D[ {RGBColor[0,0,1],Line[{ { 0, 0, 0}, f[t,{ 4, 4, 4}], f[t,{ 3.5, 3.5, 3.5}], f[t,{ 3.5, 3.6, 3.5}], f[t,{ 4, 4, 4}] , f[t,{ 3.5, 3.5, 3.5}], { 0, 0, 0} } ] } ]; (* Assignment: (1) rotate 60 degrees about the line {1,1,1}. (2) rotate 60 degrees about the line {-1,1,1}. (3) rotate 60 degrees about the line {1,-1,-1}. (a) Give the final positions of the points {1,0,0},{0,1,0},{0,0,1}. (b) Give the rotation and the axis to return everything back the way it started. *) r1 = {Cos[Pi/6],0,0,0} + Sin[Pi/6]/Sqrt[3] {0, 1, 1, 1}; r2 = {Cos[Pi/6],0,0,0} + Sin[Pi/6]/Sqrt[3] {0,-1, 1,-1}; r3 = {Cos[Pi/6],0,0,0} + Sin[Pi/6]/Sqrt[3] {0, 1,-1,-1}; v0 = look[ {1,0,0,0} ]; v1 = rook[ N[r1] ]; v2 = gook[ N[x[r2,r1]] ]; v3 = book[ N[x[x[r3,r2],r1]] ]; Show[v1,v2,v3];