Skip to content

Instantly share code, notes, and snippets.

@DanielKeep
Created September 15, 2010 07:25
Show Gist options
  • 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