# 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)&\text{lens}\\ \hline 30^\circ&-18.691732\\ 45^\circ&28.681456\\ 60^\circ&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? • – Jaroslav Jerryno Novotny Nov 22 '17 at 23:58
• thanks, so that means half_the_diagonal_of_sensor equal to 16mm, diagonal sensor is 32mm.is it specific to blender? – beetlej Nov 23 '17 at 18:49

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.

• Thanks, so d should equal to 32mm, then half d is 16mm always. – beetlej Nov 23 '17 at 18:50
• @J.Doe is there math I could use to change from a rectilinear view to an Equirectangular view or the other way around? trying to morph the camera from one type to another. – Nick Sieben Jul 25 '19 at 21:34
• hmm ther shour is... But sry i have no idea. Maybe search for Little Planet? Let me know here if you find sth! i would be very interested. – J.Doe Jul 26 '19 at 10:48

the relationship as below diagram: 