Setting the FOV of virtual camera to projector

I’m currently projection mapping on a square screen. I’m in the process of making it moveable so I’m simulating the surface and it’s position in opengl, which is working.

Now I need to actually project the image back onto the surface.
Can anyone elaborate on how to set the fov of the virtual camera to that of the projector?
I found a short (perhaps too short for me) explanation on how to do it in a very old topic:

If you know the FOV of your projector, then it’s just the 5th parameter to setupScreenPerspective():

void setupScreenPerspective(float width = 0, float height = 0, ofOrientation orientation = OF_ORIENTATION_UNKNOWN, bool vFlip = true, float fov = 60, float nearDist = 0, float farDist = 0);  

Determining that FOV is fairly tricky, but once you know it, you can just call setupScreenPerspective() in setup() or in draw() if you need to change it. I’d bind the FOV to a slider using ofxGUI so you can change it to match your scene and save it out as XML in a config file that can be loaded when the app starts up.