Advertisement
-Annie-

PointInRectangle

May 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function calc(input) {
  2.     let x = input[0];
  3.     let y = input[1];
  4.     let xMin = input[2];
  5.     let xMax = input[3];
  6.     let yMin = input[4];
  7.     let yMax = input[5];
  8.  
  9.     if(x >= xMin && x <= xMax && y >= yMin && y <= yMax) {
  10.         console.log('inside');
  11.     }
  12.  
  13.     else {
  14.         console.log('outside');
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement