This is wild. Pretty cool project. Besides the maths seeming really impressive to me, I found it interesting that portals could have different lengths. I would be curious if something like that could be made into a cool game mechanic (where something going into a wide portal would become narrower when exiting through another, reminds me of something, not sure what it was).
Sad the recursion one only supported 3 recursions, lol ;)