Thinking back a bit further in the history of my experience, I wonder if you could take inspiration from how old raycasters like Wolfenstien3D and Doom corrected the 'fish-eye' effect that results from computing ray distance from a central point, which they would then use to scale the vertical wall segment. That would produce some wierd visuals if left uncorrected, such as you would seem to be squared up to a nearby wall in the center of the screen (its floor and ceiling were flat and parallel), but as the rays marched towards the left and right extremes of the screen, the ray distance would accelerate towards infinity and cause the wall segment to shrink rapidly, pinching the floor and ceiling together.
I wrote an ASCII ray caster and had to deal with that exact case. Funny thing is the effects were so hard to interpret in ASCII that I had to convert the engine to a standard per pixel graphical raycaster to see what was going on. Wasn't aware what the phenomenon was called until years later when I started reading all of Carmack's notes on the BSPs in Doom.