\(\(\( (*\ 
      Random\ Planes\ Passing\ Through\ a\ Schrödinger\ Cube\ *) \)\(
\)\( (*\ Copyright\ May\ 2, \ 
      2006, \ \ Doug\ Youvan\ \ \ \ www . youvan . com\ \ \ \ www . 
          pseudocolor . com\ *) \)\(
\)\( (*\ 
      Allow\ 2\ minutes\ to\ run\ *) \)\(
\)\( (*\ 
      Every\ run\ is\ different; \ 
      use\ screen\ capture\ program\ for\ images\ *) \)\(
\)\(
\)\(planepoint = {Random[
          Real, {0, 1}, 3], Random[Real, {0, 1}, 3], 
        Random[Real, {0, 1}, 3]}

    normalvector\  = {Random[Real, {0, 1}, 3], Random[Real, {0, 1}, 3], 
        Random[Real, {0, 1}, 3]}
 (*solve\ p . v = 0\ *) 

    normalvector[\([1]\)]

    normalvector[\([2]\)]

    normalvector[\([3]\)]

 (*\ 
      XY\ Plane\ *) 

    x =. ; y =. ; xyplane = {};

    \(For[i = 1, i ≤ 100, \(i++\), y = i/100. ; 
        For[j = 1, j ≤ 100, \(j++\), x = j/100. ; 
          z =. ; 
z = 
            z /. Flatten[
                Solve[planepoint . {\((x - normalvector[\([1]\)])\), \((y - 
                            normalvector[\([2]\)])\), \((z - 
                            normalvector[\([3]\)])\)} == 0. ]]; 
          xyplane = Join[xyplane, {x, y, z}]]];\)

    \(xyplane = Partition[xyplane, 3];\)

    \(xyplane = Partition[xyplane, 100];\)

    For[i = 1, i ≤ 100, \(i++\), 
      For[j = 1, j ≤ 100, \(j++\), 
        If[0.  > xyplane[\([i, j, 1]\)] || xyplane[\([i, j, 1]\)] > 1.  || 
            0.  > xyplane[\([i, j, 2]\)] || xyplane[\([i, j, 2]\)] > 1.  || 
            0.  > xyplane[\([i, j, 3]\)] || xyplane[\([i, j, 3]\)] > 1. , 
          xyplane[\([i, j, All]\)] = 0. ]]]

 (*\ 
      XZ\ Plane\ *) 

    x =. ; z =. ; xzplane = {};

    \(For[i = 1, i ≤ 100, \(i++\), z = i/100. ; 
        For[j = 1, j ≤ 100, \(j++\), x = j/100. ; 
          y =. ; 
y = 
            y /. Flatten[
                Solve[planepoint . {\((x - normalvector[\([1]\)])\), \((y - 
                            normalvector[\([2]\)])\), \((z - 
                            normalvector[\([3]\)])\)} == 0. ]]; 
          xzplane = Join[xzplane, {x, y, z}]]];\)

    \(xzplane = Partition[xzplane, 3];\)

    \(xzplane = Partition[xzplane, 100];\)

    For[i = 1, i ≤ 100, \(i++\), 
      For[j = 1, j ≤ 100, \(j++\), 
        If[0.  > xzplane[\([i, j, 1]\)] || xzplane[\([i, j, 1]\)] > 1.  || 
            0.  > xzplane[\([i, j, 2]\)] || xzplane[\([i, j, 2]\)] > 1.  || 
            0.  > xzplane[\([i, j, 3]\)] || xzplane[\([i, j, 3]\)] > 1. , 
          xzplane[\([i, j, All]\)] = 
            0. ]]]


 (*\ 
      YZ\ Plane\ *) 

    y =. ; z =. ; yzplane = {};

    \(For[i = 1, i ≤ 100, \(i++\), z = i/100. ; 
        For[j = 1, j ≤ 100, \(j++\), y = j/100. ; 
          x =. ; 
x = 
            x /. Flatten[
                Solve[planepoint . {\((x - normalvector[\([1]\)])\), \((y - 
                            normalvector[\([2]\)])\), \((z - 
                            normalvector[\([3]\)])\)} == 0. ]]; 
          yzplane = Join[yzplane, {x, y, z}]]];\)

    \(yzplane = Partition[yzplane, 3];\)

    \(yzplane = Partition[yzplane, 100];\)

    For[i = 1, i ≤ 100, \(i++\), 
      For[j = 1, j ≤ 100, \(j++\), 
        If[0.  > yzplane[\([i, j, 1]\)] || yzplane[\([i, j, 1]\)] > 1.  || 
            0.  > yzplane[\([i, j, 2]\)] || yzplane[\([i, j, 2]\)] > 1.  || 
            0.  > yzplane[\([i, j, 3]\)] || yzplane[\([i, j, 3]\)] > 1. , 
          yzplane[\([i, j, All]\)] = 0. ]]]


    \(pointvector = Join[planepoint, normalvector];\)

    \(pointvectorgraphics = 
        Graphics[
          Text[StyleForm[MatrixForm[pointvector], FontSize -> 14, 
              FontWeight -> "Bold"], { .5, 1}, {0, 
              0}]];\)


    \(xyg = 
        Graphics[RasterArray[Apply[RGBColor, xyplane, {2}]], 
          AspectRatio -> Automatic, \ 
          ImageSize -> {400, 400}];\)

    \(xzg = 
        Graphics[RasterArray[Apply[RGBColor, xzplane, {2}]], 
          AspectRatio -> Automatic, \ 
          ImageSize -> {400, 400}];\)

    \(yzg = 
        Graphics[RasterArray[Apply[RGBColor, yzplane, {2}]], 
          AspectRatio -> Automatic, \ 
          ImageSize -> {400, 400}];\)

    Show[GraphicsArray[{{xyg, pointvectorgraphics}, {xzg, yzg}}, 
        GraphicsSpacing\  -> \(-0.05\), AspectRatio -> Automatic, \ 
        ImageSize -> {400, 400}]]\)\)\)