I'm interested in computing the orbits in a finite coxeter group, i.e. $D_4$ (see here ).
The orbits of the roots $\mathcal{O}(r_i)$ can be obtained by applying all the reflections $\displaystyle S_j(r_i)=r_i-2\frac{\langle r_i\mid r_j\rangle}{||r_j||}r_j$ along the roots $r_j$ since $D_4$ is generated by reflections (?).
The root system of $D_4$ is given by $\Delta=\{\pm e_i\pm e_j\mid1\leq j<i\leq n\}$
Since all roots are of norm $\sqrt{2}$ we can simplify $\displaystyle S_j(r_i)=r_i-\sqrt{2}\langle r_i\mid r_j\rangle r_j$
Now let's take two arbitrary roots $r_1=(1,1,0,0)^T,\ r_5=(0,1,1,0)^T$. By applying the reflection along $r_5$ we can see that $S_5(r_1)=r_1-\sqrt{2}r_5=(1,1-\sqrt{2},-\sqrt{2},0)^T$ is an element of $\mathcal{O}(r_1)$ which is very confusing to me. Isn't $D_4$ acting as a permutation group on its roots? I would expect only roots to be in those orbits.
You have the formula for reflections wrong:
$$ S_j(r_i)=r_i-2\frac{\langle r_i,r_j\rangle}{\langle r_j,r_j\rangle}r_j $$
Note $\langle r_j,r_j\rangle=\|r_j\|^2$.