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[ {RGBColor[1,0,0], Line[{ f[t,{ 0.1, 0.1, 0.1}], f[t,{ 4.1, 0.1, 0.1}], f[t,{ 4.1, 0.1, 8.1}], f[t,{ 4.1, 0.1, 0.1}], f[t,{ 4.1, 4.1, 0.1}], f[t,{ 4.1, 4.1, 8.1}], f[t,{ 4.1, 4.1, 0.1}], f[t,{ 0.1, 4.1, 0.1}], f[t,{ 0.1, 4.1, 8.1}], f[t,{ 0.1, 4.1, 0.1}], f[t,{ 0.1, 0.1, 0.1}], f[t,{ 0.1, 0.1, 8.1}], f[t,{ 0.1, 4.1, 8.1}], f[t,{ 4.1, 4.1, 8.1}], f[t,{ 4.1, 0.1, 8.1}], f[t,{ 0.1, 0.1, 8.1}] } ] } ]; v1 = look[ { 0 , 1, 0, 0} ]; Show[v1];