# Translating an ellipsoid

I have the equation of an ellipsoid of the form: $$ax^2 + by^2 + cz^2 + 2fyz + 2gxz + 2hxy + 2px + 2qy +2rz + d = 0$$

How does one translate the ellipsoid given above to the origin and have the equation of the form?: $$ax^2 + by^2 + cz^2 + 2fyz + 2gxz + 2hxy = 1$$

• See this question for finding the center of an ellipse from its general equation. After that, it’s just a matter of substitution. One of the answers in fact goes through this transformation in detail. The methods have obvious extensions to higher-dimensional quadrics. – amd Oct 21 '19 at 21:00
• Note, by the way, that to get a $1$ on the right-hand side, you’re likely going to have to rescale the equation after translation. In particular, the remaining coefficients will not be the same ones that you started with. In the illustration that you added, it looks like you’ve simply deleted the linear terms and set the constant term to $-1$ without making the appropriate adjustments to the remaining coefficients, which is why the two ellipses in your diagram are different sizes. – amd Oct 24 '19 at 6:45

$$x\mapsto x + (b (g r - c p) + c h q + f^2 p - f (g q + h r))/(a b c - a f^2 - b g^2 - c h^2 + 2 f g h)$$ $$y\mapsto y + (-a c q + a f r + c h p - f g p + g^2 q - g h r)/(a b c - a f^2 - b g^2 - c h^2 + 2 f g h)$$ $$z\mapsto z + (-a b r + a f q + b g p - f h p - g h q + h^2 r)/(a b c - a f^2 - b g^2 - c h^2 + 2 f g h)$$
yields the constant term $$\frac{a\,b\,c\,d-a\,d\,f^{2}-b\,d\,g^{2}+2\,d\,f\,g\,h-c\,d\,h^{2}-b\,c\,p^{2}+f^{ 2}p^{2}-2\,f\,g\,p\,q+2\,c\,h\,p\,q-a\,c\,q^{2}+g^{2}q^{2}+2\,b\,g\,p\,r-2\,f\,h\,p\,r+2\,a\,f \,q\,r-2\,g\,h\,q\,r-a\,b\,r^{2}+h^{2}r^{2}}{a\,b\,c-a\,f^{2}-b\,g^{2}+2\,f\,g\,h-c\,h^{2}}$$ which can be set to $$-1$$ by a scaling factor.