packages/odo-pointer/src/pointer-event.js
function getDirection(coord1, coord2) {
  if (Math.abs(coord1.x - coord2.x) >= Math.abs(coord1.y - coord2.y)) {
    return getTheDirection(
      coord1.x, coord2.x, Direction.LEFT,
      Direction.RIGHT, Direction.NONE,
    );
  }

  return getTheDirection(
    coord1.y, coord2.y, Direction.UP,
    Direction.DOWN, Direction.NONE,
  );
}
function getDirection(coord1, coord2) {
  if (Math.abs(coord1.x - coord2.x) >= Math.abs(coord1.y - coord2.y)) {
    return getTheDirection(
      coord1.x, coord2.x, Direction.LEFT,
      Direction.RIGHT, Direction.NONE,
    );
  }

  return getTheDirection(
    coord1.y, coord2.y, Direction.UP,
    Direction.DOWN, Direction.NONE,
  );
}
function getDirection ( coord1 , coord2 ) { if ( Math . abs ( coord1 . x - coord2 . x ) >= Math . abs ( coord1 . y - coord2 . y ) ) { return getTheDirection ( coord1 . x , coord2 . x , Direction . LEFT , Direction . RIGHT , Direction . NONE , ) ; } return getTheDirection ( coord1 . y , coord2 . y , Direction . UP , Direction . DOWN , Direction . NONE , ) ; }
angle to direction define.
@param {Coordinate} coord1 The starting coordinate.
@param {Coordinate} coord2 The ending coordinate.
@return {string} Direction constant.
angle to direction define .