画角(°)と焦点距離(mm)を変換する計算。ここでは水平画角を基準にしている。

この図から、つぎの式が成り立つ
tan(Θ/2) = (Aperture/2) / FoculLength
焦点距離から画角を計算する
tan(Θ/2) = (Aperture/2) / FoculLengthという関係なので
Θでまとめると
Θ/2 = atan((Aperture/2) / FoculLength)
Θ = 2 * atan((Aperture/2) / FoculLength)
// 焦点距離から画角を計算する
float aperture = 36; // 水平の長さ(フルサイズは36x24mm)
float focalLength = 50.0; // 焦点距離(mm)
float theta = 2 * atan2(aperture/2, focalLength);
printf('theta:' + sprintf('%g', degrees(theta)) + '°\n');
//theta:39.5978°撮像素子(36x24mm)の焦点距離50mm=画角39.59°となる
| 焦点距離 | 画角 |
| 12mm | 112.62° |
| 16mm | 96.7329° |
| 35mm | 54.4322° |
| 50mm | 39.5978° |
| 70mm | 28.8415° |
| 105mm | 19.4552° |
| 135mm | 15.1893° |
| 200mm | 10.2855° |
| 400mm | 5.15314° |
画角から焦点距離を計算する
tan(Θ/2) = (Aperture/2) / FoculLengthの式から
FoculLengthにまとめると
FoculLength = (Aperture/2) / tan(Θ/2)
// 画角から焦点距離を計算する
float aperture = 36; // 水平の長さ(フルサイズは36x24mm)
float theta = radians(30);
float focalLength = (aperture/2) / tan(theta/2);
printf('focalLength:' + sprintf('%g', focalLength) + 'mm\n');
//focalLength:67.1769mm撮像素子(36x24mm)の画角30°=焦点距離67.17mmとなる
| 画角 | 焦点距離 |
| 120° | 10.3923mm |
| 105° | 13.8119mm |
| 90° | 18mm |
| 75° | 23.4581mm |
| 60° | 31.1769mm |
| 45° | 43.4558mm |
| 30° | 67.1769mm |
| 15° | 136.724mm |
| 5° | 412.268mm |

