Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created March 2, 2014 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KelSolaar/9313959 to your computer and use it in GitHub Desktop.
Save KelSolaar/9313959 to your computer and use it in GitHub Desktop.
FOV Calculator
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