Here are some quick tips for your future artwork:
- The operation
RotationMatrix[?, {1, 0, 0}].# & /@ pts
can be recast into a more efficient form with a little linear algebra. Briefly, if you are mapping a premultiplication by a matrix over a list of points, this is equivalent to postmultiplying the list of points by the transpose of the matrix. That is, A.# & /@ list
is just the same as list.Transpose[A]
.
In this case, it is very fortuitous that the transpose of RotationMatrix[]
takes on a very convenient form. To sum up, the compact version of this operation is pts.RotationMatrix[-?, {1, 0, 0}]
.
You can redefine your function Stereo[]
so that it acts on a list of points en masse, instead of you having to map it over each point:
Stereo[pts_?MatrixQ] := Drop[pts, None, -1]/(1 - pts[[All, -1]])
With these considerations, we can redo the heart of your code as
Stereo[Flatten[pts, 1].RotationMatrix[-?, {1, 0, 0}]]
with Stereo[]
defined for a list of points.
Anyway, nice artwork, as always! :)