One of the most frequently used methods to explain the deduction of Lorentz' gamma is the idea to watch a photon traverse a distance of $c\cdot t$ in a moving object (e.g. a train) from outside the object. In the outside observer's frame the photon travels a distance of $c\cdot t'$, such that we assume $(c\cdot t)^2 + (v\cdot t')^2 = (c\cdot t')^2 \Rightarrow \dfrac{t'}{t} = \gamma = \dfrac{1}{\sqrt{1-\frac{v^2}{c^2}}}$.
So far, so good. But why must the photon traverse a path perpendicular to the object's motion? And what if we tilt the ``photon-clock'' a little bit, say by an angle of $\alpha$:
Then we gat the relationship: $(c\cdot t')^2 = (c\cdot t)^2 + (v\cdot t')^2 - 2(c\cdot t)(v\cdot t')\cdot \cos(\pi/2+\alpha)$ which can be solved for gamma as: $\gamma = \dfrac{2\sin(\alpha)\dfrac{v}{c}+\sqrt{4\sin^2(\alpha)\dfrac{v^2}{c^2}+4(1-\dfrac{v^2}{c^2})}}{2(1-\dfrac{v^2}{c^2})}$ or simpler $\gamma = \dfrac{\sin(\alpha)\beta+\sqrt{\sin^2(\alpha)\beta^2+(1-\beta^2)}}{(1-\beta^2)}$
Obviously, for $\alpha==0$ we get $\gamma = \dfrac{\sqrt{(1-\beta^2)}}{(1-\beta^2)} = \dfrac{1}{\sqrt{(1-\dfrac{v^2}{c^2})}}$ as expected. But for other angles we get other values of gamma:
Of course, I don't doubt that $\gamma = \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$, but I wonder where the mistake in my calculations is, or if that standard approach to calculating gamma by watching a moving train with a travelling photon in it, only works in the case the photon's motion is perpendicular to the train's motion.