boolean isCursorOnTopOf(int xCursor, int yCursor, int minRadius, Atom competitor) {
		// XIE: the following should be used to prevent dx2 or dy2 > Integer.MAX_VALUE
		if (screenX < 0 || screenX > SCREEN_SIZE.width || screenY < 0 || screenY > SCREEN_SIZE.height)
			return false;
		int r = screenDiameter / 2;
		if (r < minRadius)
			r = minRadius;
		int r2 = r * r;
		int dx = screenX - xCursor;
		int dx2 = dx * dx;
		if (dx2 > r2)
			return false;
		int dy = screenY - yCursor;
		int dy2 = dy * dy;
		int dz2 = r2 - (dx2 + dy2);
		if (dz2 < 0)
			return false;
		if (competitor == null)
			return true;
		int z = screenZ;
		int zCompetitor = competitor.screenZ;
		int rCompetitor = competitor.screenDiameter / 2;
		if (z < zCompetitor - rCompetitor)
			return true;
		int dxCompetitor = competitor.screenX - xCursor;
		int dx2Competitor = dxCompetitor * dxCompetitor;
		int dyCompetitor = competitor.screenY - yCursor;
		int dy2Competitor = dyCompetitor * dyCompetitor;
		int r2Competitor = rCompetitor * rCompetitor;
		int dz2Competitor = r2Competitor - (dx2Competitor + dy2Competitor);
		return (z - Math.sqrt(dz2) < zCompetitor - Math.sqrt(dz2Competitor));
	}