{0, 1, -4, 1}.(({{1, 0, 0, 0}, {0, 0, 1, 0}, {0, -1, 0, 0}, {0, 0, 0, 1}})).(({{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 3, 1}})).(({{1, 0, 0, 0}, {0, 1/2, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}})).(({{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 1}}))

a = 1/(Sqrt[2]);
h = a; i = a;T=(({{i, h, 0, 0}, {-h, i, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}));
  {h, i, 0, 1} . T

<< 
      LinearAlgebra`Orthogonalization`

    k = 3. ;  r = 1/k;

    {a, b, c} = {0, 0, -k};  {d, e, f} = 
      Normalize[{-1, 1, k}]

    T = {{(e^2 + f + f^2)/(1 + f), -d e/(1 + f), 0, 
            d r},  {-d e/(1 + f), (d^2 + f + f^2)/(1 + f), 
            0, e r}, {-d, -e, 0, 
            f r}, 
{(c d + b d e - a e^2 - a f + 
                  c d f - a f^2)/(1 + f), (-b d^2 + c e + 
                  a d e - b f + c e f - b f^2)/(1 + f), 
            0, -(a d + b e + c f)  r}};

    {-1, 1, 0, 1} . T

    {a, b, c} = {0, 2  k, -2 k};  {d, e, f} = 
      Normalize[{2  k, -2 k, 2  k}]

    T = {{(e^2 + f + f^2)/(1 + f), -d e/(1 + f), 0, 
            d r},  {-d e/(1 + f), (d^2 + f + f^2)/(1 + f), 
            0, e r}, {-d, -e, 0, 
            f r}, 
{(c d + b d e - a e^2 - a f + 
                  c d f - a f^2)/(1 + f), (-b d^2 + c e + 
                  a d e - b f + c e f - b f^2)/(1 + f), 
            0, -(a d + b e + c f)  r}};

    {2  k, 0, 0, 1} . T
  

    {a, b, c} = {0, 2  k, -k};  {d, e, f} = 
      Normalize[{0, -1, -1}]

    T = {{(e^2 + f + f^2)/(1 + f), -d e/(1 + f), 0, 
            d r},  {-d e/(1 + f), (d^2 + f + f^2)/(1 + f), 
            0, e r}, {-d, -e, 0, 
            f r}, 
{(c d + b d e - a e^2 - a f + 
                  c d f - a f^2)/(1 + f), (-b d^2 + c e + 
                  a d e - b f + c e f - b f^2)/(1 + f), 
            0, -(a d + b e + c f)  r}};

    {0, 0, -4 k, 1} . T

<< 
      LinearAlgebra`Orthogonalization`

    {a, b, c} = {0, 1. , 0};  {d, e, f} = 
      Normalize[{0, 1, 1}]

    T = {{(e^2 + f + f^2)/(1 + f), -d e/(1 + f), 0, 
            d r},  {-d e/(1 + f), (d^2 + f + f^2)/(1 + f), 
            0, e r}, {-d, -e, 0, 
            f r}, 
{(c d + b d e - a e^2 - a f + 
                  c d f - a f^2)/(1 + f), (-b d^2 + c e + 
                  a d e - b f + c e f - b f^2)/(1 + f), 
            0, -(a d + b e + c f)  r}};

    {0, 1, 10, 1}.T

Clear[a, b, c, r, k, x, y, z, 
        T];

    r = 1/k;  {a, b, c} = {1, 1, 1};

    T = {{-1, 0, 0, 0}, {0, -1, 0, 0}, {0, 0, 0, -r}, {a, b, 0, 
            c r}};

    {1, 1, -1, 1} . T

Clear[a, b, c, d, e, f, r, k]
k = Sqrt[2];  r = 1/k;
{a, b, c} = {0, 2  k, -2 k};  {d, e, 
            f} = {0, -1, - .99};
T123=
(({{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {-a, -b, -c, 1}})).(({{(e^2 + f - f^3 - e^2 f)/(1 - 
                          f^2), -e d/(1 + f), d, 0}, {-e d/(1 + f), (d^2 + f - f^3 - 
                          d^2 f)/(1 - f^2), e, 0}, {-d, -e, f, 0}, {0, 0, 0, 1}})).(({{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, r}, {0, 0, 0, 1}}))
{0, 2  k - 3, -2 k + 1, 1} . T123

\(\(\( (*\ 
      display\ two\ cubes\ as\ a\ stereo\ pair\ *) \)\(
\)\(\(Clear[Trg, Tlf, pt, e, r, 
        qt];\)
 (*Tlf = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 
            0, r}, {e, 0, 0, 1}}; 

      Trg = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, r}, {\(-e\), 0, 0, 
            1}};\ *) 

    \(Tlf = {{1, 0, 0, 0}, {0, 1, 0, 0}, {e\ r, 0, 0, r}, {0, 0, 0, 1}};\)

    \(Trg = {{1, 0, 0, 0}, {0, 1, 0, 0}, {\(-e\)\ r, 0, 0, r}, {0, 0, 0, 
            1}};\)

    \(pt = {{1, 1, 1, 1}, {\(-1\), 1, 1, 1}, {1, \(-1\), 1, 
            1}, {\(-1\), \(-1\), 1, 1}, {1, 1, \(-1\), 1}, {\(-1\), 
            1, \(-1\), 1}, {1, \(-1\), \(-1\), 1}, {\(-1\), \(-1\), \(-1\), 
            1}, {1, 1, 1, 1}};\)

    e =  .1; r = 3;

    \(qt = Table[0, {i, 9}, {j, 4}];\)

    Do[qt[\([i]\)] = pt[\([i]\)] . Tlf, {i, 1, 9}]; \  (*\ 
      use\ Tlf\ for\ other\ image\ *) 
Do[
      qt[\([i, 1]\)] = qt[\([i, 1]\)]/qt[\([i, 4]\)], {i, 1, 
        9}];

    \(Do[qt[\([i, 2]\)] = qt[\([i, 2]\)]/qt[\([i, 4]\)], {i, 1, 9}];\)

    ListPlot[Table[{qt[\([i, 1]\)], qt[\([i, 2]\)]}, {i, 1, 9}], 
      PlotJoined -> True, Axes -> False]

    \)\)\)

Clear[a, b, 
        tabl1, tabl2];

    a =  .001;  b =  .001;

    tabl1 = 
        Table[Point[{i, j}],  {i, -10, 10,  5},  {j, -10, 10,  
            5}];

    f[x_, y_] := -(1/2. ) 
          Exp[-a x^2 - b y^2];

    tabl2 = 
        Table[Point[{i, j}/(1 + f[i, j])],  {i, -10, 10,  
            5},  {j, -10, 10,  5}];

    Show[Graphics[tabl1]]

    Show[Graphics[tabl2]]

Clear[k, n, P, Q, L]

    k = 10;  n = 50;

    scal[q_] := (k Tan[ArcTan[q/k]/2])/q;

    P = 
        Table[{Random[Real, {-10. , 10. }], 
            Random[Real, {-10. , 
                10. }]},  {n}];

    Q = 
        Table[Sqrt[P[[i]] . P[[i]]],  {i, 
            n}];

    L = 
        Table[Line[{P[[i]], scal[Q[[i]]] P[[i]]}],  {i, 
            n}];

    Show[Graphics[L],  Graphics[Circle[{0, 0}, 10]], 
      Graphics[Point[{0, 0}]],  
      AspectRatio -> 
        1]

(* 
      exercise for hemispherical fisheye projection *) 
k = 1;

    scal[q_] := (k Tan[ArcTan[q/k]/2])/q;

    {scal[1. ], scal[10. ],  scal[100. ],  scal[1000. ],  
      scal[10000. ]}

(* 
      Offaxis hemispherical fisheye projection *) 
Clear[k, n, P, Q, L, Pt];

    k = 10;  n = 50;

    scal[q_] := (k Tan[ArcTan[q/k]/2])/q;

    P = 
        Table[{Random[Real, {-10. , 10. }], 
            Random[Real, {-10. , 10. }]},  {n}];

    x = -5;  
    y = 5;   (* Location of viewer *) 
Pt = 
      P - Table[{x, y},  {n}];

    Q = 
        Table[Sqrt[Pt[[i]] . Pt[[i]]],  {i, 
            n}];

    L = 
        Table[Line[{P[[i]] + {x, 
                  y}, (scal[Q[[i]]] P[[i]]) + {x, y}}],  {i, 
            n}];

    Show[Graphics[L],  
      Graphics[Circle[{0, 0}, 
          k]], 
Graphics[{AbsolutePointSize[5], 
          Point[{0, 0}]}], 
Graphics[{AbsolutePointSize[5], 
          Point[{x, y}]}], 
 
      AspectRatio -> Automatic,  
      PlotRange -> All]

k = 10. ;   
Table[k z/(z + k),  {z, 0, 100, 5}]
Table[%[[i + 1]] - %[[i]],  {i, 1, 
        20}]
Table[
        Point[{%%[[i]], 0}],  {i, 1, 21}];
Show[Graphics[%]]
l = 20. ; r = 0.1;
Table[
      l (1 - (z r/(z + l))),  {z, 0, 100, 
        5}]
Table[%[[i]] - %[[i + 1]],  {i, 1, 
        20}]
Table[
      Line[{{i, 17}, {i, %%[[i]]}}],  {i, 1, 
        21}]
Show[Graphics[%]]