Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Created September 3, 2009 14:40
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 jakearchibald/180336 to your computer and use it in GitHub Desktop.
Save jakearchibald/180336 to your computer and use it in GitHub Desktop.
return (
a[2] < b[0] ? 0 :
b[2] < a[0] ? 0 :
a[0] < b[0] ? (a[2] < b[2] ? a[2] - b[0] : b[2] - b[0]) :
b[2] < a[2] ? b[2] - a[0] : a[2] - a[0]
) * (
a[1] < b[3] ? 0 :
b[1] < a[3] ? 0 :
a[3] < b[3] ? (a[1] < b[1] ? a[1] - b[3] : b[1] - b[3]) :
b[1] < a[1] ? b[1] - a[3] : a[1] - a[3]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment