Skip to content

Instantly share code, notes, and snippets.

@kdabir
Created November 25, 2015 08:24
Show Gist options
  • Save kdabir/bf7b003190faf784c294 to your computer and use it in GitHub Desktop.
Save kdabir/bf7b003190faf784c294 to your computer and use it in GitHub Desktop.
Check screen size diagonally by providing height and width
sqr = (n) -> n*n
sqrt = (n) -> Math.sqrt n
hypt = (h,w) -> sqrt (sqr(h) + sqr(w))
console.log hypt(10, 6.5)
console.log hypt(10, 6)
console.log hypt(6, 9)
console.log hypt(6, 9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment