Consider the following function $$\sum_{i=1}^3{ \frac{(q_i-d_i)^2}{a_i} },$$ which can be seen as an anisotropic inner product in the $\vec{q}$ vector space that is rescaled by $a_i$’s and offset by $\vec{d}$. In general, constant $a_i$’s are nonzero and unequal. $\vec{d}$ is a constant vector in $\vec q$ space.
My question is the following. Can one rotate in the $\vec{q}$ space and thus express the above function in some new $\tilde{q}_i,\tilde{d}_i$ in order to have only one nonzero $\tilde{d}_i$ for $i=1,2,3$ (i.e., align new $\tilde{\vec d}$ along one axis)?