Camera angle of view from focal length
The camera angle of view can be calculated with trigonometry using the focal length and sensor width.
Looking at the right triangle formed by the half of the full drawn triangle: half of the angle \(\theta\) is the inverse tangent of the fraction of half of the sensorwidth and focal length.
This simplifies to:
\(\theta = 2\tan^{-1}\biggl({{ sw }\over{ 2fl }}\biggr)\)
In VEX code:
float sensor_width; float focal_length; //radians float aov = 2*atan( sensor_width / ( 2*focal_length ) ); //convert to degrees aov *= 180/PI;