The parametric function for describing a helix that traces out a torus can be described in the following way:
$x(t) = (R + r\cos(t))\cos(\frac{t}{n})$
$y(t) = (R + r\cos(t))\sin(\frac{t}{n})$
$z(t) = r\sin(t)$
where $R$ is the major radius of the torus and $r$ is the minor radius. $n$ is the number of loops in the torus.
Here is an example with $R$ of 6, $r$ of 7 and an $n$ of 12:

Now I know for a fact, that this torus can be flattened without squishing the loops of the torus by rotating the top of the torus clockwise and rotating the bottom counterclockwise. However, I cannot think of how to model this mathematically. What sort of modification to the function can describe this flattening for the torus? Any thoughts and answers would be appreciated.