Skip to content

Instantly share code, notes, and snippets.

@DanielKeep
Created September 15, 2010 07:25
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 DanielKeep/580365 to your computer and use it in GitHub Desktop.
Save DanielKeep/580365 to your computer and use it in GitHub Desktop.
"
Function to compute DPI from diagonal screen length
and pixel dimensions.
Written in MathEval: http://github.com/DanielKeep/MathEval
"
let dpi(phD, pxW, pxH) = pxW / (phD / sqrt((pxH/pxW)**2 + 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment