Given two $n$ dimensional positive definite matrices $A', B'$, is there a matrix $O \in SO(n)$ such that $A=O A', B=O B'$ and $$ \frac{A_{ij}}{\sqrt{A_{ii}A_{jj}}} = \frac{B_{ij}}{\sqrt{B_{ii}B_{jj}}}, i,j \in \{1,2,\ldots,n\}.~~~~~~~~ (1) $$
The above algebra question is from an geometry question: Given two affine coordinate system $\{a'_1, a'_2, \ldots, a'_n\}$ and $\{b'_1, b'_2, \ldots, b'_n\}$ in $n$ dimensional space, is there a matrix $O \in SO(n)$ such that $a_i = \sum_j O_{ij} a'_j$ and $b_i = \sum_j O_{ij} b'_j$ and the angle between each pair $a_i, a_j$ and $b_i, b_j$ is same.
Remark 1: The answer is yes for $n=2$. Intermediate value theorem can do this work. That is, choose $O=(\cos(x),\sin(x);-\sin(x),\cos(x))$ and define \begin{equation} f(x) = angle(a_1 \rightarrow a_2) - angle(b_1 \rightarrow b_2), \end{equation} then $f(0) = -f(\pi/2)$. Thus there must be a point $c \in (0, \pi/2)$ such that $f(c) = 0$, that is $angle(a_1 \rightarrow a_2) = angle(b_1 \rightarrow b_2)$. But this method may be hardly to solve the general $n$ dimensional case.
Remark 2: There are $n(n-1)/2$ independent parameters in $O$ and the number of constraints in the equation $(1)$ is also $n(n-1)/2$. It seems that the answer for the general $n$ deimensional case is also yes.
Remark 3: The question in the language of algebra may be more general than the one in the language of geometry, because $$ angle(a_1, a_2) + angle(a_1, a_3) \geq angle(a_2, a_3), $$ while there is no corresponding limits in the algebraic one.
Remark 4: The answer for the general $n$ dimensional case is yes if $A'B' = B'A'$ because they can be diagonlized at the same time.
I will also be appreciate if you revise this post or add some proper tags.