Connections between model theory and algebraic and analytic geometry