I'm playing with a 3d environment where i (the camera) am at the center of a sphere (both the camera and the center of the sphere are positioned at the 0,0,0 origin point) and the sphere has a 360 degree image mapped onto it like http://core0.staticworld.net/images/article/2015/08/360-degree-ricoh-theta-100609103-large.jpg
from my center perspective everything looks proper without any warping like the outside looking in perspective in the previous image. and in my sphere i have marked the boundaries of the hallway floor which yields a long trapezoidal plane. Like when you see the horizon/vanishing point for a long road.
The question is: what is the process to calculate the length of the hallway (in 3d environment units) as a rectangular plane (the true shape of the hallway) instead of the trapezoidal one that i marked for myself?