Created
March 2, 2014 21:09
-
-
Save KelSolaar/9313959 to your computer and use it in GitHub Desktop.
FOV Calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
diagonal = lambda w, h: math.sqrt(w ** 2 + h ** 2) | |
wr = 36. # Reference 24mm * 36mm sensor. | |
hr = 24. | |
dr = diagonal(wr, hr) | |
w = 7.6 # Current sensor: http://en.wikipedia.org/wiki/Image_sensor_format | |
h = 5.7 | |
d = diagonal(w, h) | |
cropFactor = dr / d | |
f = 7.2 # Current focal. | |
print 2 * math.degrees(math.atan(w / (2 * f))) # Current sensor FOV. | |
f = 7.2 * cropFactor | |
print 2 * math.degrees(math.atan(wr / (2 * f))) # 24mm * 36mm equivalent FOV. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment