The goal is here to calculate the coordinates of the points connecting the external straight lines tangent to 2 circles (see figures herebellow).

Two cases have to be considered:

- The general case where ,
- The case where .

(circles where ) | (circles where ) |

Remark: As far as possible, the equations will be simplified.

## 1- Case where

### 1-1 The principle

By beginning by the general case, i.e. the one where the 2 radii are different (and non equal to zero of course), some particularities will be highlighted…

As we did in the post on the fillets calculation (see post fillet calculation in 2D for more information), the tangent points are the intersecting points of the circles:

- of centre where is the middle of and of radius ,
- of centre where is the middle of and of radius .

(Principle of the calculation of the tangent points) |

### 1-2) Calculation of the centre dilatation

Since , a dilatation centre exists that transforms in (see figure hereafter).

(case where) |

Let the point with the coordinates

From Thalès’ theorem, we can write that .

Then , or even

So the system becomes

After calculations, the point expresses as:

(1)

### 1-3) Calculation of the tangent points to

As told previously, these are the intersecting points between the circles and so that:

(Remind that is the middle of ).

By substracting the equation of to the one of , it leads to the new equation:

The later one is rewritten with

Since is the middle of , then

Eq (1) is reinjected into the previous equations and we get:

(2)

Since:

From eq. (1), the “prime” terms are recalculated:

Using the previous equations, including them into we finally have:

(3)

equation and one are reinjected into the equation of to lead to a 2^{nd} degree equation:

with

Therefore

(4)

### 1-4) Calculation of the tangent points to

We proceed to the same manner as we did previously, and in order to highlight the current document, only the main results are presented:

(5)

(6)

By reinjection into equation to have:

And then:

(7)

**Discussions on the values of and :**

We know that the angles and (with ) are right; then the of the angles is equal to zero.

The Algorithm could be:

for k1 = 1 if cos(angle(T_i A C)) = 0 +/- precision then ok else k1 = -1 end if

In another way, we can notice that the sign of (as well as the one of ) is the opposite of the sign of the slope (*remind*: is the slope of the straight line ) :

– if then

– if then

*Remarks*:

- remind that the case where (i.e. ) is a case apart that will be specifically treated,
- and are the upper points of respectively the circle and the one;
- and , are le lower points.

From the previous remarks, the equations (4) and (7) are rewritten:

; ;

; ;

(with ).

### 1-5) Particular Cases

The equations (2), (3), (5) and (6) show it is necessary to treat the cases where (ditto for ) i.e. when the denominator(s) become(s) equal to zero.

#### a) case where

(case where ) |

The previous calculations are done from the beginning by noticing that ; the system is simplified to:

(8)

(9)

**Discussions on the values of and :**

Basically, since and , then:

- if and , we’re on the points and that have been chosen as the upper points,
- and and , we’re on et that are the lower ones.

By considering a single variable , the equations are simplified to:

; ;

; ;

#### b) case where

(case where ) |

The previous results are re-used by noticing that , and by circular permutation, the system becomes:

(10)

(11)

**Discussions on the values of and :**

Again by circular permutation:

- if and , we have the points et which we’re the upper points and they become now the ones on the right,
- and si and , the points et move on the left.

By considering a single variable , the equations are simplified to:

; ;

; ;

## 2) Particular case =

(case where and ) | (case where and ) |

(case where and ) |

No dilatation since the tangent lines are parallel to . Then 2 different strategies are possible:

- the calculation of the equations of the tangents using derivatives,
- the calculation of the distance from a point of the tangent to the straight line , knowing that where is the equation of .

Only the first approach using derivatives has been used here (case 1.).

### 2-1 General case

Remind first that, since the 2 straight lines are parallel, they have the same slope that can be expressed as:

(12)

Remind as well that ; the circles equations are consequently:

(where et are the derivative functions of and ).

The derivatives are rewritten:

with and .

Do not forget the general expressions of the tangent equation on the points and :

And , ,

i.e.

(13)

After reinjection of eq(13) into the circle equation (and after noticing during the development that ), then:

(14)

We proceed in the same manner for with :

(15)

and

(16)

**Discussions on the values of and :**

For : As for the general case, the sign of and depends on the one of the slope :

– if then

– if then

For : we can note that the sign is the opposite of the one, that allows to rewrite the previous equations using a single variable where :

; ;

;

### 2-2 Case where

The equations remain quite simple and can be expressed as:

; ; ;

Please note that the previous equations remain valid (see section 2-1) since = 0 in that particular case.

### 2-3 Case where

Unlike the previous particular case, the general equations cannot be applied as it stands since ) is at the denominator; nevertheless the system remains quite simple and it can be expressed as:

; ; ;

## 3) Checks

An Excel^{®} file (see check_circles_tangentes – compressed with 7z) presents the checks (9 cases) – Geogebra files have been inserted into.

## 4) Scilab programs

In coming

This work