# Conversion between anisotropic temperature factors and geometric ellipsoids

I am using the ANISOU of the PDB standard to represent ellipsoid shaped colloids. I am writing a Monte Carlo simulation to transform the position and orientation of the ellipsoids and want to use a PDB file to represent the result.

I am not sure how to convert between a geometric representation of an ellipsoid to the anisotropic temperature factor tensor, $\mathbf{U}$. I am able to define an ellipsoid aligned to the coordinate axes using the diagonal elements of $\mathbf{U}$: $\mathbf{U}(1,1)$, $\mathbf{U}(2,2)$, $\mathbf{U}(3,3)$, but I am not sure how to represent a rotated ellipsoid, i.e., I am not sure how to set $\mathbf{U}(1,2)$, $\mathbf{U}(1,3)$, and $\mathbf{U}(2,3)$. I came across this resource which introduces the topic. This second link mentions the similarity between tensor elements and geometric definitions and says the conversion is "rather complicated" but does not provide a link for further study.

Any guidance or direction to a good resource would be appreciated.