I'd like to know if I can get the matrix
$$B = \begin{bmatrix} a_1^2 + a_2^2 + a_3^2 & 0 & 0\\ 0 & b_1^2 + b_2^2 + b_3^2 & 0 \\ 0 & 0 & c_1^2 + c_2^2 + c_3^2\end{bmatrix}$$
given the matrix
$$A=\begin{bmatrix}a_1 & a_2 & a_3\\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3\end{bmatrix}$$
solely by applying matrix operations such as inversion, transposition, addition and multiplication.
This came up when I was deriving some formulas about $\nabla$ in curvilinear coordinates, but I'm not able to work it out. I could only see that if $\{(a_1,a_2,a_3),(b_1,b_2,b_3),(c_1,c_2,c_3)\}$ is an orthogonal basis of $\mathbb{R}^3$, then $B=AA^{\top}$. I want to generalize this result.