How this calculation works
Find numerical common tangent-line candidates for two ellipses,with explicit contact points and line residuals. Same-side supporting tangents and opposite-side tangents are distinguished.
h_i(n)=n·c_i+sqrt(nᵀM_i n); solve equal signed support offsets for unit normals n.A worked example
Two unit circles centered at(0,0)and(4,0)have four common tangent lines. Two are y=1 and y=−1;the other two pass between the circles and have contact points on opposite sides of their shared normal.
Good to know
Ellipse rows cx,cy,positive a,b,angle degrees. Bounded2048-angle sign-change/near-sample search with bisection. Returns candidates only;unsampled double roots can be missed. Coincident tangent families rejected. Floating geometry,no complete tangency-count certificate.
Reference: Convex support functions and ellipsoids (opens in a new tab) ↗
Common tangents concern lines rather than intersections
Two ellipses can be disjoint and still have several common tangent lines. A common tangent touches each boundary without cutting through that ellipse locally,so solving for shared boundary points addresses a different geometric question.
The returned line is represented by a unit normal n and offset b in n dot x=b. Contact points on both ellipses accompany it,which allows direct verification of the line equation and the intended side relationship.
Compare this with the Ellipse ellipse intersection calculator from equations. Curve intersection points are not lines simultaneously tangent to both ellipses.
Semiaxes and orientation define each support function
An ellipse is entered by center,two positive semiaxes and a rotation angle in degrees. Its symmetric shape matrix M contains squared semiaxes rotated into the coordinate frame. The square root of n transpose M n gives its support distance from the center.
The angle is an orientation of the ellipse’s principal axis,not a tangent direction or a polar parameter. Equal semiaxes describe a circle and make that orientation irrelevant,providing a useful limit for checking the general formulas.
Two signed support comparisons find different families
For same-side supporting tangents,the maximum projections of the two ellipses onto a candidate normal are equal. Opposite-side tangents compare a maximum projection of one ellipse with a minimum projection of the other.
The search scans normal angle over a full turn and refines bracketed roots. Reversing a normal and offset describes the same undirected line,so duplicate geometric lines are merged instead of counted twice simply because their parameter angles differ by pi.
The two-circle default gives four clear witnesses
Unit circles four units apart have upper and lower horizontal supporting lines at offsets plus and minus one. The separation also leaves room for two internal tangent lines that pass through the gap and touch opposite sides.
The default should therefore return four distinct candidate lines. Contact-point residuals should be small for each. This checks external and internal support choices together,while a count alone could hide duplicated horizontal lines or omitted internal branches.
Contacts are reconstructed analytically from the normal
For an ellipse with shape matrix M,the outward contact offset is Mn divided by the square root of n transpose M n. Adding it to the center gives the supporting point;changing its sign gives the opposite contact.
The page evaluates both contacts after solving the scalar angle equation. Their agreement with a single line offset is an independent geometric reconstruction check within floating arithmetic. It is more informative than presenting only a root angle from an opaque numerical solver.
Sampling does not certify every tangency
When an angle function merely touches zero without changing sign,a finite scan can miss that double root unless a sample happens to resolve it. Such cases arise near touching,coincident or transition configurations where the number of common tangents changes.
The page explicitly labels outputs as candidates. Zero candidates is not a certified absence result for every degenerate pair. Coincident families are rejected rather than reduced to an arbitrary finite list that would misrepresent infinitely many valid lines.
Use candidate lines with an appropriate tolerance
For practical geometry,compare the reported contact and line residuals with the scale of the ellipse coordinates. A line suitable at one numerical tolerance may be insufficient when the same coordinates represent a much smaller physical clearance.
The calculator does not trim paths,resolve near coincidence through measurement uncertainty or prove global completeness. Retain the candidate-search limitation when exporting the line list so a useful numerical construction is not turned into an unsupported exact count.
A few questions, answered
Can disjoint ellipses have common tangents?
Yes. Disjoint circles in the default have four common tangent lines.
Is zero candidates a proof of no tangents?
No. The finite scan can miss unsampled double-root cases.
What is the line equation convention?
The unit normal and offset describe n dot x=b.
Why reject coincident families?
They can contain infinitely many tangents rather than a finite isolated list.