tools/geom/diagonals.js
function getIndexForLoc(loc) {
  var col = Math.floor(loc.x / total_width);
  var row = Math.floor(loc.y / total_width);
  var index = col + (row * 5);
  return index;
}
function getIndexForLoc(loc) {
  var col = Math.floor(loc.x / total_width);
  var row = Math.floor(loc.y / total_width);
  var index = col + (row * 5);
  return index;
}
function getIndexForLoc ( loc ) { var col = Math . floor ( loc . x / total_width ) ; var row = Math . floor ( loc . y / total_width ) ; var index = col + ( row * 5 ) ; return index ; }
Given a location, return the index of the element that is present at that location. If it doesn't correspond to a good index, then it is -1.
Given a location return the index of the element that is present at that location . If it doesn t correspond to a good index then it is - 1 .