Skip to content

Instantly share code, notes, and snippets.

@brettcannon
Last active December 19, 2015 23: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 brettcannon/6032922 to your computer and use it in GitHub Desktop.
Save brettcannon/6032922 to your computer and use it in GitHub Desktop.
Calculation of the visual acuity limit for the closest distance to sit to your television. Using the defaults, if you plug in the diagonal size of your TV, the value will be (in inches) the closest you can sit to your 1080p television showing 1080p content and not see individual pixels. Equation taken from http://en.wikipedia.org/wiki/Optimum_HD…
import math
arcminute = math.tan(math.pi/10800) # tan(1/60) in radians.
def visual_acuity_seating_distance(diagonal_in_inches, *, native_horizontal_resolution=1920, native_vertical_resolution=1080,
content_vertical_resolution=1080):
"""Calculate the closest you should sit to your television, in inches."""
return (diagonal_in_inches /
(math.sqrt((native_horizontal_resolution/native_vertical_resolution)**2 + 1) * content_vertical_resolution * arcminute))
def recommended_distances(diagonal_in_inches):
""""Calculate viewing distance based on some common ratios/viewing angles: 20, 30, and 40 degrees respectively."""
return diagonal_in_inches * 2.5, diagonal_in_inches * 1.6, diagonal_in_inches * 1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment