code: public static int getDirection (
          MisoSceneMetrics metrics, int ax, int ay, int bx, int by)
      {
          Point afpos = new Point(), bfpos = new Point();
  
          // convert screen coordinates to full coordinates to get both
          // tile coordinates and fine coordinates
          screenToFull(metrics, ax, ay, afpos);
          screenToFull(metrics, bx, by, bfpos);
  
          // pull out the tile coordinates for each point
          int tax = fullToTile(afpos.x);
          int tay = fullToTile(afpos.y);
  
          int tbx = fullToTile(bfpos.x);
          int tby = fullToTile(bfpos.y);
  
          // compare tile coordinates to determine direction
          int dir = getIsoDirection(tax, tay, tbx, tby);
          if (dir != DirectionCodes.NONE) {
              return dir;
          }
  
          // destination point is in the same tile as the
          // origination point, so consider fine coordinates
  
          // pull out the fine coordinates for each point
          int fax = afpos.x - (tax * FULL_TILE_FACTOR);
          int fay = afpos.y - (tay * FULL_TILE_FACTOR);
  
          int fbx = bfpos.x - (tbx * FULL_TILE_FACTOR);
          int fby = bfpos.y - (tby * FULL_TILE_FACTOR);
  
          // compare fine coordinates to determine direction
          dir = getIsoDirection(fax, fay, fbx, fby);
  
          // arbitrarily return southwest if fine coords were also equivalent
          return (dir == -1) ? SOUTHWEST : dir;
      }
docs: Given two points in screen pixel coordinates, return the
  compass direction that point B lies in from point A from an
  isometric perspective.
  
  @param ax the x-position of point A.
  @param ay the y-position of point A.
  @param bx the x-position of point B.
  @param by the y-position of point B.
  
  @return the direction specified as one of the <code>Sprite</code>
  class's direction constants.