1 Introduction

The circle of Apollonius is defined as a set of all points whose distances from two fixed points have a constant ratio that is not equal to one. [8]. This ratio is denoted by the symbol \(\mu \). Consider two points A and B, the circle of Apollonius is a set of all points M, for which the following relationship must be satisfied:

$$\begin{aligned} |AM|=\mu |BM|, \end{aligned}$$

where \(\mu \not =1\).

The points of the circle of Apollonius are seen under an equal angle from two collinear segments AF and FB. In general, if we consider two curves instead of two segments, we obtain a curve known as an equioptic curve. Such equioptic curves of conic sections are investigated in [7]. Paper [1] generalises the circle of Apollonius by using the power of the point A with respect to a circle. Another interesting generalization of the circle of Apollonius in spherical geometry is presented in [6].

Following the introduction of certain concepts, we proceed to define the concept of the circle of Apollonius in a new way.

Let K be a 0-symmetric, bounded, convex body in the Euclidean n-space \(\mathbb {E}^n\) (with a fixed origin O). The convex body K defines a norm whose unit ball is K itself ([2] or [9]). Such a space is a Minkowski normed space. The norm is a continuous function on the vectors of \(\mathbb {E}^n\) which may be considered a gauge function. This norm induces a so-called Minkowski metric. The unit ball is strictly convex if its boundary contains no line segment [3, 4].

Consider two circles with different radii, 1 and \(\mu \). These define two different norms. Let A and B be the centres of the circles. The set of all points whose distances from A and B are equal in the different norms is the circle of Apollonius. This implies that the bisector of A and B is a circle of Apollonius in this case. It is generally defined as follows:

Definition 1.1

If K and \(K'\) are 0-symmetric, bounded, convex bodies, then the set of points equidistant from their centres with respect to the norms determined by K and \(K'\) is defined as the surface(curve) of Apollonius in the Euclidean n-space \(\mathbb {E}^n\).

Figure 1 illustrates the fact that the curve of Apollonius is not generally convex nor 0-symmetric, even for bounded, strictly convex 0-symmetric bodies, which are similar in shape to circles in two-dimensional planes.

Fig. 1
figure 1

The curve of Apollonius of two convex bodies

In general, the curve of Apollonius is not bounded. It is often challenging to determine the shape of this curve or surface of Apollonius in most cases. In the following section, the surface of Apollonius in the case where both bodies are ellipsoids is considered in greater detail.

2 Surface of Apollonius of two ellipsoids

We first introduce some fundamental notation, then we will proceed to present two elementary lemmas.

Let \(\textbf{x}=(x_1,x_2, \dots ,x_n)^T\) be an n-dimensional vector and \(\textbf{x}_b= (x_1,\) \(x_2, \dots ,x_n,1)^T\) be an \((n+1)\)-dimensional vector. Consequently \(\textbf{x}^T_b=(\textbf{x}^T,1)\), where T denotes the transpose. The \((n+1) \times (n+1)\) symmetric matrix Q is defined as follows:

$$\begin{aligned} \textbf{Q}= \left( \begin{array}{cccc} a_{1,1} &{}\quad a_{1,2} &{}\quad \cdots &{}\quad a_{1,n+1} \\ a_{2,1} &{}\quad a_{2,2} &{}\quad \cdots &{}\quad a_{2,n+1} \\ \vdots &{}\quad \vdots &{}\quad \ddots &{}\quad \vdots \\ a_{n+1,1} &{}\quad a_{n+1,2} &{}\quad \cdots &{}\quad a_{n+1,n+1} \\ \end{array} \right) . \end{aligned}$$

The vector \((a_{1,n+1},\) \(a_{2,n+1}, \dots ,a_{n,n+1})^T\) is designated by the symbol \(\textbf{a}\). The matrix \(\textbf{A}_{n+1,n+1}\) is used to denote the usual submatrix of matrix \(\textbf{Q}\):

$$\begin{aligned} \textbf{A}_{n+1,n+1}= \left( \begin{array}{cccc} a_{1,1} &{}\quad a_{1,2} &{}\quad \cdots &{}\quad a_{1,n} \\ a_{2,1} &{}\quad a_{2,2} &{}\quad \cdots &{}\quad a_{2,n} \\ \vdots &{}\quad \vdots &{}\quad \ddots &{}\quad \vdots \\ a_{n,1} &{}\quad a_{n,2} &{}\quad \cdots &{}\quad a_{n,n} \\ \end{array} \right) . \end{aligned}$$

Matrix Q can be expressed in the following form, using the previously defined notations:

$$\begin{aligned} \textbf{Q}= \left( \begin{array}{cc} \textbf{A}_{n+1,n+1} &{}\quad \textbf{a}\\ \textbf{a}^T &{}\quad a_{n+1,n+1} \\ \end{array} \right) . \end{aligned}$$

The equation

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b=0 \end{aligned}$$

defines a second-order (quadratic) algebraic surface in a higher-dimensional space [5]. In the following section, we consider ellipsoids when \(|\textbf{A}_{n+1,n+1}|\not = 0\) and \(|\textbf{Q}|\not = 0\).

Let \(\textbf{u}=(u_1,u_2, \dots ,u_n)^T\) be an arbitrary point in the n-dimensional space. It is clear that the following equality is true:

$$\begin{aligned} \begin{aligned}&(\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u})=(\textbf{x}^T \textbf{A}_{n+1,n+1} -\textbf{u}^T \textbf{A}_{n+1,n+1})(\textbf{x}-\textbf{u})=\qquad \\&=\textbf{x}^T \textbf{A}_{n+1,n+1} \textbf{x} -\textbf{x}^T \textbf{A}_{n+1,n+1}\textbf{u}-\textbf{u}^T \textbf{A}_{n+1,n+1} \textbf{x} +\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}. \end{aligned} \end{aligned}$$
(2.1)

In accordance with Eq. 2.1, the expression \(\textbf{x}^T \textbf{A}_{n+1,n+1} \textbf{x}\) may be expressed as follows:

$$\begin{aligned}{} & {} \textbf{x}^T \textbf{A}_{n+1,n+1} \textbf{x}=\\{} & {} =(\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) + \textbf{x}^T \textbf{A}_{n+1,n+1}\textbf{u} +\textbf{u}^T \textbf{A}_{n+1,n+1} \textbf{x} -\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}. \end{aligned}$$

The quadratic form \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b\) can be easily converted by simply completing the square:

$$\begin{aligned}{} & {} \textbf{x}^T_b \textbf{Q}\textbf{x}_b =(\textbf{x}^T,1) \left( \begin{array}{cc} \textbf{A}_{n+1,n+1} &{} \textbf{a}\\ \textbf{a}^T &{} a_{n+1,n+1} \\ \end{array} \right) \left( \begin{array}{c} \textbf{x}\\ 1 \\ \end{array} \right) =\\{} & {} =\textbf{x}^T \textbf{A}_{n+1,n+1} \textbf{x}+\textbf{a}^T \textbf{x}+ \textbf{x}^T \textbf{a}+a_{n+1,n+1}=\\{} & {} =(\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) + \textbf{x}^T \textbf{A}_{n+1,n+1}\textbf{u} +\textbf{u}^T \textbf{A}_{n+1,n+1} \textbf{x} -\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}\\{} & {} +\textbf{a}^T \textbf{x}+ \textbf{x}^T \textbf{a}+a_{n+1,n+1}. \end{aligned}$$

Since the matrix \(\textbf{A}_{n+1,n+1}\) is symmetric, it follows that

$$\begin{aligned} \textbf{x}^T \textbf{A}_{n+1,n+1}\textbf{u} = \textbf{u}^T \textbf{A}_{n+1,n+1} \textbf{x} \end{aligned}$$

and

$$\begin{aligned} \textbf{a}^T \textbf{x}=\textbf{x}^T \textbf{a}. \end{aligned}$$

Consequently, we have the following equality:

$$\begin{aligned} \textbf{x}^T \textbf{A}_{n+1,n+1}\textbf{u}+\textbf{x}^T \textbf{a} = \textbf{u}^T \textbf{A}_{n+1,n+1} \textbf{x}+\textbf{a}^T \textbf{x}. \end{aligned}$$

As the determinant of the matrix \(\textbf{A}_{n+1,n+1}\) is non-zero, there exists a solution \(\textbf{u}\) to the system of equations

$$\begin{aligned} \textbf{A}_{n+1,n+1}\textbf{u}+ \textbf{a}=\textbf{0}. \end{aligned}$$
(2.2)

The preceding calculations lead to the following conclusion.

Lemma 2.1

If \(|\textbf{A}_{n+1,n+1}|\not = 0\), then the quadratic form \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b\) can be expressed as follows:

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b= (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) -\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}+a_{n+1,n+1} \end{aligned}$$
(2.3)

where \(\textbf{u}\) is the solution of the system of linear equations \(\textbf{A}_{n+1,n+1}\textbf{u}+ \textbf{a}=\textbf{0}\).

Lemma 2.2

If \(|\textbf{A}_{n+1,n+1}|\not = 0\) and \(\textbf{u}\) is the solution of the system of linear equations \(\textbf{A}_{n+1,n+1}\textbf{u}+ \textbf{a}=\textbf{0}\), then in the quadratic form \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b= (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) -\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}+a_{n+1,n+1}\), the expression \(a_{n+1,n+1}-\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}\) is equal to

$$\begin{aligned} \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$
(2.4)

Proof

According to Cramer’s rule, the solution of the system of linear equations 2.2 is:

$$\begin{aligned} u_i= \frac{\left| \begin{array}{cccccccc} a_{1,1} &{} a_{1,2} &{}\cdots &{} a_{1,i-1}&{} -a_{1,n+1} &{} a_{1,i+1}&{}\cdots &{} a_{1,n}\\ a_{2,1} &{} a_{2,2} &{} \cdots &{}a_{2,i-1}&{} -a_{2,n+1} &{} a_{2,i+1}&{}\cdots &{}a_{2,n}\\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ a_{n,1} &{} a_{n,2} &{} \cdots &{} a_{n,i-1}&{} -a_{n,n+1} &{} a_{n,i+1}&{}\cdots &{}a_{n,n}\\ \end{array} \right| }{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$

Firstly, multiply one column by \((-1)\) and, subsequently, swap two columns of the determinant \((n-i)\)-times. This yields the following result:

$$\begin{aligned} u_i= \frac{(-1)\cdot (-1)^{n-i} \left| \begin{array}{cccccccc} a_{1,1} &{} a_{1,2} &{}\cdots &{} a_{1,i-1} &{} a_{1,i+1}&{}\cdots &{} a_{1,n} &{} a_{1,n+1}\\ a_{2,1} &{} a_{2,2} &{} \cdots &{}a_{2,i-1} &{} a_{2,i+1}&{}\cdots &{}a_{2,n}&{} a_{2,n+1}\\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots \\ a_{n,1} &{} a_{n,2} &{} \cdots &{} a_{n,i-1} &{} a_{n,i+1}&{}\cdots &{}a_{n,n}&{} a_{n,n+1}\\ \end{array} \right| }{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$

The determinant in the numerator is the minor of the matrix Q, which is denoted by \(\left| A_{n+1,i}\right| \). On the other hand \((-1)\cdot (-1)^{n-i}=(-1)^{n+1-i}=(-1)^{n+1+i}\), thus the value of \(u_i\) is given by the following equation:

$$\begin{aligned} u_i= \frac{(-1)^{n+1+i}\cdot \left| A_{n+1,i}\right| }{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$
(2.5)

The vector \(\textbf{u}\) is the solution of the system of linear equations 2.2, thus

$$\begin{aligned} -\textbf{u}^T \textbf{A}_{n+1,n+1}=\textbf{a}^T. \end{aligned}$$

Consequently, the following equation is also true:

$$\begin{aligned}{} & {} a_{n+1,n+1}-\textbf{u}^T \textbf{A}_{n+1,n+1}\textbf{u}=a_{n+1,n+1}+\textbf{a}^T \textbf{u}\\{} & {} \quad =a_{n+1,n+1}+ \sum _{i=1}^{n} a_{n+1,i} \cdot \frac{(-1)^{n+1+i}\cdot \left| A_{n+1,i}\right| }{|\textbf{A}_{n+1,n+1}|}=\\{} & {} \quad = \frac{\displaystyle {\sum _{i=1}^{n}} (-1)^{n+1+i}\cdot a_{n+1,i} \cdot \left| A_{n+1,i}\right| }{|\textbf{A}_{n+1,n+1}|}+\frac{a_{n+1,n+1} \cdot |\textbf{A}_{n+1,n+1}|}{|\textbf{A}_{n+1,n+1}|}=\\{} & {} \quad = \frac{\displaystyle {\sum _{i=1}^{n+1}} (-1)^{n+1+i}\cdot a_{n+1,i} \cdot \left| A_{n+1,i}\right| }{|\textbf{A}_{n+1,n+1}|}= \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$

The initial step in this calculation was to apply equation 2.5, which was followed by the computation of the sum. Subsequently, the Laplace expansion along the \((n+1)\)th row was applied to the determinant \(|\textbf{Q}|\). \(\square \)

A straightforward consequence of equations 2.3 and 2.4 is the following theorem:

Theorem 2.3

If \(|\textbf{A}_{n+1,n+1}|\not = 0\) and \(\textbf{u}\) is the solution of the system of linear equations \(\textbf{A}_{n+1,n+1}\textbf{u}+ \textbf{a}=\textbf{0}\), then the quadratic form \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b\) can be expressed as follows:

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b= (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) + \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$
(2.6)

Theorem 2.4

If the equation of a second-order algebraic surface (quadratic surface) in a higher-dimensional space is given by

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b=0 \end{aligned}$$

and \(|\textbf{A}_{n+1,n+1}|\not = 0\), \(|\textbf{Q}|\not = 0\) and the vector \(\textbf{u}\) is the solution of the system of linear equations \(\textbf{A}_{n+1,n+1}\textbf{u}+ \textbf{a}=\textbf{0}\), then the equation of the scaled quadratic surface with scale factor \(\lambda \), using the point \(\textbf{u}\) as the centre of enlargement, can be written as

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b=(1-\lambda ^2 )\cdot \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$
(2.7)

Proof

It is clear that if the equation of the quadratic surface is

$$\begin{aligned} (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) + \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}=0, \end{aligned}$$

then the equation of the scaled quadratic surface with scale factor \(\lambda \) from the point \(\textbf{u}\) as the centre is

$$\begin{aligned} (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) + \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}\lambda ^2 =0. \end{aligned}$$
(2.8)

On the other hand, equation 2.6 of Theorem 2.3 demonstrates that

$$\begin{aligned} (\textbf{x}-\textbf{u})^T \textbf{A}_{n+1,n+1}(\textbf{x}-\textbf{u}) = \textbf{x}^T_b \textbf{Q}\textbf{x}_b- \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}. \end{aligned}$$
(2.9)

Consequently, equations 2.8 and 2.9 yield the following result:

$$\begin{aligned} \textbf{x}^T_b \textbf{Q}\textbf{x}_b- \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}+ \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|}\lambda ^2 =0. \end{aligned}$$

This implies that if the quadric is given by the equation \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b=0\), then the equation of the scaled quadratic surface with scale factor \(\lambda \) from the centre \(\textbf{u}\) is given by equation 2.7. \(\square \)

Theorem 2.5

Consider two ellipsoids with equations \( \textbf{x}^T_b \textbf{Q}\textbf{x}_b =0\) and \(\textbf{x}^T_b \mathbf {Q'}\textbf{x}_b=0\). The surface of Apollonius of two ellipsoids is a quadratic surface with the equation:

$$\begin{aligned} \textbf{x}^T_b \left( \frac{|\textbf{A}_{n+1,n+1}|}{|\textbf{Q}|}\cdot \textbf{Q} - \frac{|\mathbf {A'}_{n+1,n+1}|}{|\mathbf {Q'}|}\cdot \mathbf {Q'} \right) \textbf{x}_b=0. \end{aligned}$$
(2.10)

Proof

The equations \(\textbf{x}^T_b \textbf{Q}\textbf{x}_b =0\) and \(\textbf{x}^T_b \mathbf {Q'}\textbf{x}_b=0\) define two ellipsoids, which in turn define two different norms. According to these norms, the set of points equidistant from the centres of the ellipsoids is the surface of Apollonius. The sets of points at distance \(\lambda \) from the centres of the ellipsoids are scaled ellipsoids with scale factor \(\lambda \) from the centres of the ellipsoids, whose equations are given by equation 2.7 of theorem 2.4

$$\begin{aligned}{} & {} \textbf{x}^T_b \textbf{Q}\textbf{x}_b=(1-\lambda ^2 )\cdot \frac{|\textbf{Q}|}{|\textbf{A}_{n+1,n+1}|},\\{} & {} \textbf{x}^T_b \mathbf {Q'}\textbf{x}_b=(1-\lambda ^2 )\cdot \frac{|\mathbf {Q'}|}{|\mathbf {A'}_{n+1,n+1}|}. \end{aligned}$$

The common points of the two equations are the set of points that are located at distance \(\lambda \) from the centre of the two ellipsoids with respect to the above norms. These points therefore form the surface of Apollonius by Definition 1.1. Figure 2 illustrates the points on the curve of Apollonius for which \(\lambda =2\).

Fig. 2
figure 2

The points on the curve of Apollonius for which \(\lambda =2\)

Since the two quadratic surfaces are ellipsoids, it follows that \(|\textbf{A}_{n+1,n+1}|\not = 0\), \(|\textbf{Q}|\not = 0\) and \(|\textbf{A}'_{n+1,n+1}|\not = 0\), \(|\textbf{Q}'|\not = 0\). Consequently, \(1-\lambda ^2\) can be expressed, and the two equations can be combined to yield the following result:

$$\begin{aligned} \frac{|\textbf{A}_{n+1,n+1}|}{|\textbf{Q}|}\cdot \textbf{x}^T_b \textbf{Q}\textbf{x}_b=1-\lambda ^2 = \frac{|\mathbf {A'}_{n+1,n+1}|}{|\mathbf {Q'}|}\cdot \textbf{x}^T_b \mathbf {Q'}\textbf{x}_b. \end{aligned}$$

Consequently, we have that:

$$\begin{aligned} \textbf{x}^T_b \left( \frac{|\textbf{A}_{n+1,n+1}|}{|\textbf{Q}|}\cdot \textbf{Q} - \frac{|\mathbf {A'}_{n+1,n+1}|}{|\mathbf {Q'}|}\cdot \mathbf {Q'} \right) \textbf{x}_b=0, \end{aligned}$$

where the matrix

$$\begin{aligned} \frac{|\textbf{A}_{n+1,n+1}|}{|\textbf{Q}|}\cdot \textbf{Q} - \frac{|\mathbf {A'}_{n+1,n+1}|}{|\mathbf {Q'}|}\cdot \mathbf {Q'} \end{aligned}$$

is symmetric, thus indicating that it represents the equation of a quadratic surface. \(\square \)

3 Sphere of Appollonius

In this section we investigate whether the surface of Apollonius of two ellipsoids can be a sphere. This is called the sphere of Appollonius. A trivial case is where both ellipsoids are spheres. Are there any other cases?

Theorem 3.1

The surface of Apollonius of two ellipsoids q and \(q'\) is a sphere if and only if their corresponding axes are parallel and the following equation holds for lengths \(a_i\) and \(a'_i\) of all their parallel semi-axes:

$$\begin{aligned} -\frac{1}{a_i^2}+\frac{1}{(a'_i)^2}=c, \end{aligned}$$

where \(i=1,2,\dots , n\) and \(c\not =0\) is a constant.

Proof

Without loss of generality, we may assume that the ellipsoid q is canonical, meaning that its centre coincides with the origin of the coordinate system and its axes align with the coordinate system’s axes. In this case, its standard equation is:

$$\begin{aligned} \sum _{i=1}^{n} \frac{x_i^2}{a_i^2}=1. \end{aligned}$$

Consequently, the matrix of the quadratic form takes a specific form:

$$\begin{aligned} \textbf{Q}= \left( \begin{array}{ccccc} \frac{1}{a_1^2}&{} 0 &{} 0&{} \cdots &{} 0 \\ 0 &{}\frac{1}{a_2^2} &{} 0 &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{}\frac{1}{a_n^2} &{} 0 \\ 0 &{} 0 &{} \cdots &{} 0 &{} -1 \\ \end{array} \right) . \end{aligned}$$

It is evident that

$$\begin{aligned} \frac{|\textbf{A}_{n+1,n+1}|}{|\textbf{Q}|}=-1. \end{aligned}$$

The ellipsoid \(q'\) is general, thus the matrix of the sphere of Apollonius by Eq. 2.10 of Theorem 2.5 is:

$$\begin{aligned} \begin{aligned}&\left( \begin{array}{ccccc} -\frac{1}{a_1^2}&{} 0 &{} 0&{} \cdots &{} 0 \\ 0 &{}-\frac{1}{a_2^2} &{} 0 &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{}-\frac{1}{a_n^2} &{} 0 \\ 0 &{} 0 &{} \cdots &{} 0 &{} 1 \\ \end{array} \right) \\&\hspace{2.3cm} -\frac{|\textbf{A}'_{n+1,n+1}|}{|\textbf{Q}'|} \left( \begin{array}{cccc} a_{1,1}' &{} a_{1,2}' &{} \cdots &{} a_{1,n+1}' \\ a_{2,1}' &{} a_{2,2}' &{} \cdots &{} a_{2,n+1}' \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ a_{n+1,1}' &{} a_{n+1,2}' &{} \cdots &{} a_{n+1,n+1}' \\ \end{array} \right) . \end{aligned} \end{aligned}$$
(3.1)

On the other hand, the matrix of the general sphere is as follows:

$$\begin{aligned} \left( \begin{array}{ccccc} 1&{} 0 &{} \cdots &{} 0 &{} a_{1,n+1}'' \\ 0 &{}1 &{} &{} 0 &{} a_{2,n+1}'' \\ \vdots &{} &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{} 1 &{} a_{n,n+1}'' \\ a_{n+1,1}'' &{} a_{n+1,2}'' &{} \cdots &{} a_{n+1,n}'' &{} a_{n+1,n+1}'' \\ \end{array} \right) . \end{aligned}$$

The equality of matrices of the two quadrics implies that \(a_{i,j}'=0\), where \(i\not =j\) and \(i,j\le n\). This indicates that the principal axes of the two ellipsoids are parallel to the coordinate axes. Consequently, the equation of the ellipsoid \(q'\) can be written as:

$$\begin{aligned} \sum _{i=1}^{n} \frac{(x_i-u'_i)^2}{(a'_i)^2}=1, \end{aligned}$$

where \(\textbf{u}'\) is the center of the ellipsoid.

That is the matrix \(Q'\) of the ellipsoid \(q'\) can be given in the following form:

$$\begin{aligned} \textbf{Q}'= \left( \begin{array}{ccccc} \frac{1}{(a'_1)^2}&{} 0 &{} \cdots &{} 0 &{} -\frac{u'_1}{(a'_1)^2} \\ 0 &{}\frac{1}{(a'_2)^2} &{} &{} 0 &{} -\frac{u'_2}{(a'_2)^2} \\ \vdots &{} &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{}\frac{1}{(a'_n)^2} &{} -\frac{u'_n}{(a'_n)^2} \\ -\frac{u'_1}{(a'_1)^2} &{} -\frac{u'_2}{(a'_2)^2} &{} \cdots &{} -\frac{u'_n}{(a'_n)^2} &{} \sum _{i=1}^{n} \frac{(u'_i)^2}{(a'_i)^2}-1\\ \end{array} \right) . \end{aligned}$$
(3.2)

The matrix \(Q'\) of the ellipsoid allows for the conclusion that:

$$\begin{aligned} \frac{|\mathbf {A'}_{n+1,n+1}|}{|\mathbf {Q'}|}=-1. \end{aligned}$$

The matrix \(\textbf{S}\) of the sphere of Apollonius can be derived from matrices 3.1 and 3.2:

$$\begin{aligned} \begin{aligned} \textbf{S}&= \left( \begin{array}{ccccc} -\frac{1}{a_1^2}&{} 0 &{} 0&{} \cdots &{} 0 \\ 0 &{}-\frac{1}{a_2^2} &{} 0 &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{}-\frac{1}{a_n^2} &{} 0 \\ 0 &{} 0 &{} \cdots &{} 0 &{} 1 \\ \end{array} \right) \\&\quad +\left( \begin{array}{ccccc} \frac{1}{(a'_1)^2}&{} 0 &{} \cdots &{} 0 &{} -\frac{u'_1}{(a'_1)^2} \\ 0 &{}\frac{1}{(a'_2)^2} &{} &{} 0 &{} -\frac{u'_2}{(a'_2)^2} \\ \vdots &{} &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{}\frac{1}{(a'_n)^2} &{} -\frac{u'_n}{(a'_n)^2} \\ -\frac{u'_1}{(a'_1)^2} &{} -\frac{u'_2}{(a'_2)^2} &{} \cdots &{} -\frac{u'_n}{(a'_n)^2} &{} \sum _{i=1}^{n} \frac{(u'_i)^2}{(a'_i)^2}-1\\ \end{array} \right) . \end{aligned} \end{aligned}$$

On the other hand, if the centre of the sphere is denoted by the vector \(\mathbf {\bar{u}}\) and the radius of the sphere by \(\bar{r}\), then the matrix of the sphere is:

$$\begin{aligned} \bar{\textbf{S}}=\left( \begin{array}{ccccc} 1&{} 0 &{} \cdots &{} 0 &{} -\bar{u}_1 \\ 0 &{}1 &{} &{} 0 &{} -\bar{u}_2 \\ \vdots &{} &{} \ddots &{} &{} \vdots \\ 0 &{} 0 &{} &{} 1 &{} -\bar{u}_n \\ -\bar{u}_1 &{} -\bar{u}_2 &{} \cdots &{} -\bar{u}_n &{} \sum _{i=1}^{n} \bar{u}_i^2-\bar{r}^2 \\ \end{array} \right) \end{aligned}$$

Two quadratic surfaces (in our case, two spheres) with equations \( \textbf{x}^T_b \textbf{S}\textbf{x}_b=0\) and \(\textbf{x}^T_b \bar{\textbf{S}}\textbf{x}_b=0\) are equivalent if and only if there exists a constant \(c\not =0\) such that \(\textbf{S}=c\cdot \bar{\textbf{S}}\). Consequently, for all values of \(i=1,2,\dots ,n\) the following equalities must be satisfied:

$$\begin{aligned}{} & {} -\frac{1}{a_i^2}+\frac{1}{(a'_i)^2}=c,\\{} & {} -\frac{u'_i}{(a'_i)^2}=-\bar{u}_i \cdot c,\\{} & {} \sum _{i=1}^{n} \frac{(u'_i)^2}{(a'_i)^2}=c\cdot \left( \sum _{i=1}^{n} \bar{u}_i^2-\bar{r}^2\right) . \end{aligned}$$

Thus the aforementioned statement has been proven, and the centre and radius of the sphere of Apollonius can now be determined. Figure 3 illustrates the circle of Apollonius, derived from two initial ellipses. \(\square \)

Fig. 3
figure 3

The circle of Apollonius of two ellipses

This actually means that the parameters \(u_i'\), \(a_i'\) of the ellipsoid \(q'\) and the constant c determine the parameters \(a_i\) of the ellipsoid q, the centre \(\mathbf {\bar{u}}\) and the radius \(\bar{r}\) of the sphere of Apollonius:

$$\begin{aligned} \mathbf {\bar{u}} =\frac{1}{c}\left( \frac{u'_1}{(a'_1)^2}, \frac{u'_2}{(a'_2)^2}, \dots , \frac{u'_n}{(a'_n)^2}\right) \end{aligned}$$

and

$$\begin{aligned} \bar{r}^2= \sum _{i=1}^{n} \bar{u}_i^2 - \frac{1}{c} \sum _{i=1}^{n} \frac{(u'_i)^2}{(a'_i)^2}= \sum _{i=1}^{n} \left( \frac{1}{c} \frac{(u'_i)}{(a'_i)^2}\right) ^2- \frac{1}{c} \sum _{i=1}^{n} \frac{(u'_i)^2}{(a'_i)^2}. \end{aligned}$$
(3.3)

If both ellipsoids are spheres, then the following notations can be introduced: \(a_i=r\) and \(a'_i=r'\) for all \(i=1,2,\dots ,n\). This allows us to express the relationship between the radii of the spheres as follows:

$$\begin{aligned} -\frac{1}{r^2}+\frac{1}{(r')^2}=c. \end{aligned}$$

This implies that the radii of the spheres can take any value. The above expression can be transformed into the following form:

$$\begin{aligned} \frac{1}{c}= \frac{(r')^2 r^2}{r^2-(r')^2}. \end{aligned}$$
(3.4)

It can be demonstrated that, by applying equations 3.3 and 3.4

$$\begin{aligned}{} & {} \bar{r}^2= \sum _{i=1}^{n} \left( \frac{(r')^2 r^2}{r^2-(r')^2} \frac{(u'_i)}{(r')^2}\right) ^2- \frac{(r')^2 r^2}{r^2-(r')^2} \sum _{i=1}^{n} \frac{(u'_i)^2}{(r')^2}=\\{} & {} = \left( \left( \frac{ r^2}{r^2-(r')^2} \right) ^2 -\frac{ r^2}{r^2-(r')^2} \right) \sum _{i=1}^{n} (u'_i)^2. \end{aligned}$$

Let us begin by introducing the notation \(\lambda =\frac{r}{r'}\) and subsequently transforming the expression obtained:

$$\begin{aligned} \bar{r}^2 = \left( \left( \frac{ \lambda ^2}{\lambda ^2-1} \right) ^2 -\frac{ \lambda ^2}{\lambda ^2-1} \right) \sum _{i=1}^{n} (u'_i)^2= \frac{ \lambda ^2}{\left( \lambda ^2-1\right) ^2} \sum _{i=1}^{n} (u'_i)^2. \end{aligned}$$

Consequently, the standard formula for calculating the radius of the circle of Apollonius was derived.

4 In the plane

This section examines whether all degenerate and non-degenerate conic sections can be presented as curves of Apollonius in the plane.

The above notations are applied in the following theorem, which is well-known in the field of mathematics: if the determinant of the matrix Q is zero, then the conic section is degenerate; otherwise, it is non-degenerate. In the degenerate case, we have a point when \(|A_{3,3}| > 0\), two parallel lines (possibly coinciding) when \(|A_{3,3}| = 0\), or two intersecting lines when \(|A_{3,3}| < 0\). In the non-degenerate case we have an ellipse when \(|A_{3,3}| > 0\), a parabola when \(|A_{3,3}| = 0\), or a hyperbola when \(|A_{3,3}| < 0\). This theorem will form the foundation of a classification of the curves of Apollonius.

Theorem 4.1

All degenerate and non-degenerate conic sections can be presented as curves of Apollonius in the plane.

Proof

It is established that affinity does not change the type of conic sections, and thus an affinity that transforms the ellipse into a circle, \(q'\), can be used. Without loss of generality, we may assume that the centre of the ellipse q is the origin. Consequently, the equation of the ellipse q is given by \(\frac{x^2}{a^2}+\frac{y^2}{b^2}=1\), while the equation of the circle \(q'\) is given by \((x-u)^2+(y-v)^2=r^2\). In the plane, the vector \(\textbf{x}_b^T\) is defined as (xy, 1). Consequently,

$$\begin{aligned} \textbf{Q}=\left( \begin{array}{ccr} \frac{1}{a^2} &{} 0 &{} 0\\ 0 &{} \frac{1}{b^2} &{} 0\\ 0 &{} 0 &{} -1\\ \end{array} \right) \, \hbox {and} \, \textbf{Q}'=\left( \begin{array}{rrc} 1 &{} 0 &{} -u\\ 0 &{} 1 &{} -v\\ -u &{} -v &{} u^2+v^2-r^2\\ \end{array} \right) . \end{aligned}$$

The values of the determinants and sub-determinants can be easily calculated:

$$\begin{aligned}{} & {} \frac{|\textbf{A}_{3,3}|}{|\textbf{Q}|}=-1,\\{} & {} \frac{|\textbf{A}'_{3,3}|}{|\mathbf {Q'}|}=\frac{1}{- r^2}. \end{aligned}$$

The equation of the curve of Apollonius, as defined by Eq. 2.10 of Theorem 2.5, is a quadratic curve with the following equation:

$$\begin{aligned} \textbf{x}^T_b \left( - 1\cdot \left( \begin{array}{ccr} \frac{1}{a^2} &{} 0 &{} 0\\ 0 &{} \frac{1}{b^2} &{} 0\\ 0 &{} 0 &{} -1\\ \end{array} \right) - \frac{1}{- r^2} \cdot \left( \begin{array}{rrc} 1 &{} 0 &{} -u\\ 0 &{} 1 &{} -v\\ -u &{} -v &{} u^2+v^2-r^2\\ \end{array} \right) \right) \textbf{x}_b=0. \end{aligned}$$

Once the operations have been completed, the equation of the quadratic curve is

$$\begin{aligned} \textbf{x}^T_b \left( \begin{array}{ccc} \frac{1}{r^2} -\frac{1}{a^2}&{} 0 &{} -\frac{u}{r^2}\\ 0 &{} \frac{1}{r^2}-\frac{1}{b^2} &{} -\frac{v}{r^2}\\ -\frac{u}{r^2} &{} -\frac{v}{r^2}&{} \frac{u^2+v^2}{r^2}\\ \end{array} \right) \textbf{x}_b=0. \end{aligned}$$

The initial step is to calculate the values of the determinants of the matrices \(Q''\) and \(A''_{3,3}\) using the conventional notation. These values determine the types of conic sections, as established by the aforementioned theorem.

$$\begin{aligned}{} & {} |Q''|=\left( \frac{1}{r^2} -\frac{1}{a^2}\right) \left( \left( \frac{1}{r^2} -\frac{1}{b^2}\right) \frac{u^2+v^2}{r^2}-\frac{v^2}{r^4} \right) -\frac{u}{r^2}\frac{u}{r^2}\left( \frac{1}{r^2} -\frac{1}{b^2}\right) =\\{} & {} =\left( \frac{1}{r^2} -\frac{1}{a^2}\right) \left( \frac{u^2+v^2}{r^4}-\frac{u^2+v^2}{r^2 b^2}-\frac{v^2}{r^4} \right) -\frac{u^2}{r^4}\left( \frac{1}{r^2} -\frac{1}{b^2}\right) =\\{} & {} =\left( \frac{1}{r^2} -\frac{1}{a^2}\right) \left( \frac{u^2}{r^4}-\frac{u^2+v^2}{r^2 b^2}\right) -\frac{u^2}{r^4}\left( \frac{1}{r^2} -\frac{1}{b^2}\right) =\\{} & {} =\frac{u^2}{r^6} -\frac{u^2}{r^4 b^2}-\frac{v^2}{r^4 b^2}-\frac{u^2}{r^4 a^2}+\frac{u^2}{r^2 a^2 b^2} +\frac{v^2}{r^2 a^2 b^2}-\frac{u^2}{r^6}+\frac{u^2}{r^4 b^2}= \end{aligned}$$
$$\begin{aligned}{} & {} =\frac{-v^2 a^2-u^2 b^2+r^2 u^2+r^2 v^2}{r^4 a^2 b^2}=\frac{v^2(r^2- a^2)+u^2 (r^2-b^2)}{r^4 a^2 b^2} \end{aligned}$$
(4.1)
$$\begin{aligned}{} & {} |A''_{3,3}|=\left( \frac{1}{r^2} -\frac{1}{a^2} \right) \left( \frac{1}{r^2} -\frac{1}{b^2} \right) \end{aligned}$$
(4.2)

The results are presented in tabular form in Table 1.

Table 1 Curve of Apollonius of two ellipses in the plane

It is evident that if \(a=b=r\) or \(u=v=0\), then the determinant of \(Q''\) is equal to zero by expression 4.1. Consequently, in these instances, degenerate conics are obtained.

To begin, consider the case where both \(a=b=r\) and \(u=v=0\). In this scenario, both curves are circles of radius r centered at the origin. This implies that the two circles are identical. Consequently, all points on the plane are equidistant from the centers. In this instance, the elements of the matrix \(Q''\) are all zeros.

If \(a=b=r\) but u and v are not both zero, then the elements of the matrix \(A''_{3,3}\) are all zeros, and thus \(|A''_{3,3}|=0\). Consequently, the curve of Apollonius is a line (coinciding parallel lines). Visually, both curves are circles of radius r with different centres, and thus the curve of Apollonius is the bisector of the two centres.

If \(u=v=0\) and \(a=r\), \(b\not =r\) or \(a\not =r\), \(b=r\), then the determinant of the matrix \(A''_{3,3}\) is equal to zero in accordance with equation 4.2. Consequently, the curve of Apollonius is a line (coinciding parallel lines). In the event \(a>r\), \(b>r\) or \(a<r\), \(b<r\), the determinant of the matrix \(A''_{3,3}\) is greater than zero, due to the fact that both factors are positive in equation 4.2. Consequently, the curve of Appolonius is a point. When \(a>r\), \(b<r\) or \(a<r\), \(b<r\), the determinant of the matrix \(A''_{3,3}\) is negative. This is because the two factors in expression 4.2 have different signs. This implies that the curve of Apollonius comprises two intersecting lines.

In the following section, we consider the cases where a and b are not both equal to r, and where u and v are not both equal to 0. In the majority of cases, we obtain a non-degenerate conic section. However, there are also degenerate cases. Let us examine these in more detail.

In cases where \(a=r\), \(b\not =r\) and \(u=0\), \(v\not =0\) or \(a\not =r\), \(b=r\) and \(u\not =0\), \(v=0\), both terms of the numerator \(v^2(r^2- a^2)+u^2 (r^2-b^2)\) of expression 4.1 are zero. This implies that the determinant of the matrix \(Q''\) is also zero. Furthermore, the determinant of the matrix \(A''_{3,3}\) is equal to zero in accordance with equation 4.2. Consequently, the curve of Apollonius is degenerate, and the curve is represented by two parallel lines.

If \(a=r\), \(b\not =r\) and \(u\not =0\), \(v=0\) or \(u\not =0\), \(v\not =0\); \(a\not =r\), \(b=r\) and \(u=0\), \(v\not =0\) or \(u\not =0\), \(v\not =0\), then one term in the numerator of expression 4.1 is zero, while the other term is not zero. This implies that the determinant of the matrix \(Q''\) is not zero. Similarly to the previous case, the determinant of the matrix \(A''_{3,3}\) is equal to zero in accordance with equation 4.2. Consequently, the curve of Apollonius is non-degenerate, and the curve is represented by a parabola.

In the event when \(a>r\), \(b>r\) or \(a<r\), \(b<r\), then both factors of the expression 4.2 have the same sign. This signifies that the determinant of the matrix \(A''_{3,3}\) is greater than zero. Furthermore, if u and v are not both zero, it is evident that the determinant of the matrix \(Q''\) is not zero. Consequently, the curve of Apollonius is an ellipse.

If \(a>r\), \(b<r\) or \(a<r\), \(b>r\), then it can be demonstrated that two factors of expression 4.2 have different signs. This implies that the determinant of the matrix \(A''_{3,3}\) is less than zero. When \(u\not =0\), \(v=0\) or \(u=0\), \(v\not =0\), then one term in the numerator of expression 4.1 is zero, while the other term is not zero. This implies that the determinant of the matrix \(Q''\) is not zero. Consequently the curve of Apollonius is a hyperbola. If \(u\not =0\), \(v\not =0\) then the expression \(v^2(r^2- a^2)+u^2 (r^2-b^2)\) can be zero or non-zero, too. Consequently, the curve of Apollonius can be either two intersecting lines or a hyperbola. \(\square \)