I know the formula to calculate a camera's angle of view given the film size and the focus distance. I.e., 35mm film at 50mm focal length. It works just fine returning the AOV.
Formula in python:
d = 35 # Film Width
f = 50 # Focal Length
aov = 2 * math.atan(float(d) / (2*float(f)))
which results in an AOV of 38.58
My question is how would I calculate the Focal Length f
given the film size d
and the aov?
You can calculate the focal length with:
f = d / (2 * math.tan(0.5 * aov))
This is derived from the theorem of intersecting lines and the tangents in right-angled triangles:
(0.5 * d)/f = a/b = tan(0.5 * aov)