Math logic between camera angle and lens Camera has two properties:

bpy.data.objects['Camera'].data.angle
bpy.data.objects['Camera'].data.lens


If change one value, the other one will be changed automatically.
I am curious about the math logic.

From the table below:

$$
\begin{array}{c|c}
\text{angle }(\theta)&amp;\text{lens}\\
\hline
30^\circ&amp;-18.691732\\
45^\circ&amp;28.681456\\
60^\circ&amp;2.497919
\end{array}
$$

Sounds like the formula is: $\text{lens}=\tan{\frac{\theta}{2}}$, but what's the theory come from. I found a diagram about camera as below but not figure out how to match this formula with this diagram:

Is this logic specific to blender or it's generic for all camera's?
The angle of view for a rectilinear projection camera is calculated by:

$$a=2\arctan{\frac{d}{2f}}$$

$a$: angle of view
$d$: dimension of the sensor (horizontal or vertical)
$f$: effective focal length

horizontal and vertical angle of view differ if your camera sensor is not a perfect square.