Equation of a surface (hyperellipsoid?) with specific conditions Suppose I have two vectors $a,b \in \mathbb{R}^n$, and a scalar $\alpha$ where $0 < \alpha < 1$. If $d_a(x)$ is the distance from any point $x \in \mathbb{R}^n$ to point $a$, and $d_b(x)$ is the distance from point $x$ to point $b$, then I want to find the equation of the surface defined by $d_a(x) = \alpha d_b(x)$. I suspect this is hyperellipsoidal, but am not sure.
My preference would be that the distance metric is defined as $d^2_a(x) = (x-a)^TS(x-a)$ for some positive semi-definite (?) $n \times n$ matrix $S$ (Mahalanobis distance). Is it possible to find the equation of this (hyperellipsoidal?) surface in terms of $a, b, \alpha$ and $S$?
 A: Your notation is a bit strange; I would expect that any "distance" function would have two arguments, not one. However, making some assumptions ...
The equation of the surface seems to be:
$$ (\mathbf x - \mathbf a)^T \mathbf S (\mathbf x - \mathbf a) = \alpha
(\mathbf x - \mathbf b)^t \mathbf S (\mathbf x - \mathbf b)$$
Let's look at the $\mathbb R^3$ case in more detail. If you write out coordinates for $\mathbf a$ and $\mathbf b$, and write $\mathbf x = (x,y,z)$, then you can multiply everything out and get an equation of the form $f(x,y,z)=0$. When you do this, you can make your life easier (without losing any generality) by assuming that $\mathbf a = (a,0,0)$ and $\mathbf b = \mathbf 0$. The function $f$ will be a polynomial of total degree 2, and this means that the surface is a quadric surface, at least. Whether or not it's an ellipsoid will depend on the nature of the matrix $\mathbf S$. If $\mathbf S$ is the identity matrix, then the coefficients of $x^2$, $y^2$ and $z^2$ will all be equal, and so the surface will be a sphere.
To decide the surface type in general, you need to know about classification of quadrics. There are 17 types (roughly -- it depends how you count), and you can figure out which type you have by computing certain determinants from the coefficients of $f$, or, more directly, from the entries in the matrix $\mathbf S$. Following Rahul's suggestion in the comment, the equation from above can be written as
$$ \mathbf x^T \left( (1 - \alpha)\mathbf S \right)\mathbf x + \text{lower order terms} = 0$$
Then, standard results about quadratic forms tell us that the classification depends on the signs of the eigenvalues of $(1-\alpha)\mathbf S$. See this page on quadratic forms, especially the section on "geometric meaning", or this document. 
The case $n=2$ is very similar, of course. Your equation represents a conic section curve, which may or may not be an ellipse.
I can't say much about the cases where $n>3$. I live in $\mathbb R^3$ :-) 
