Skip to content

Instantly share code, notes, and snippets.

@idvorkin
Last active November 29, 2015 18:04
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 idvorkin/20bcec402ee5ff5ed906 to your computer and use it in GitHub Desktop.
Save idvorkin/20bcec402ee5ff5ed906 to your computer and use it in GitHub Desktop.
Computer Monitor Size Given Ratio and Diagonal
# From http://ig2600.blogspot.com/2015/11/monitor-sizes-and-ratios.html
# Example:
# > sizeBoth(27,1.77)
#[1] 13.28117 23.50767
size <- function (dim,ratio) dim/sqrt(1+(ratio)^2)
sizeBoth <- function (dim,ratio) c(size(dim,ratio), ratio*size(dim,ratio))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment