The purpose of this research is to provide a framework for the analysis and comparison of contact detection algorithms for pairs of ellipses and ellipsoids. This work focuses primarily on the category of algorithms that are the most computationally efficient and can produce estimates of the separation and the penetration distance between ellipses and ellipsoids. Specifically, only analytic representations of the ellipses and ellipsoids are considered and contact detection for moving pairs of ellipsoids is not treated. The first contribution is a mathematical framework for the study of these algorithms, most notably with existence and uniqueness proofs for classes of contact detection algorithms, formal descriptions of the asymptotics of pairs of ellipses in close contact (or overlap), and a global analysis of constraints on the normals. The framework highlights the key role played by the different definitions of contact found in the literature, independent of the numerical strategies deployed to estimate the separation/penetration distance. Specifically, it is shown that all the studied algorithms can be expressed as minimization problems, with or without non-binding constraints on the normal(s) at the contact point(s), and that the constraints can be used to identify the global minima among the critical points in the minimization problem. Another contribution of this research, based on the mathematical framework introduced, is a better classification of the known algorithms. These algorithms are compared on established test problems, and their strengths and weaknesses are highlighted and explained in terms of their classification. Furthermore, this research provides comparisons in speed and stability between the most efficient algorithms in each category over a large sample size of test problems. Among the other contributions, this research describes inexpensive but effective initial estimates of the contact to be used in iterative algorithms. Finally, the usefulness of the new framework is illustrated with the introduction of a fast algorithm combining some new and old ideas