This is my attempt of simple derivation of time dilation from a moving photon clock. Consider this schematics:
A) is photon clock as seen from a photon clock reference frame (or as by observer outside when photon clock would be stationary)
B) is when photon clock moves, and is seen by observer outside of photon clock reference frame.
According to A) in one clock tick (1 period) photon moves distance $2L$ (height of clock), so photon speed is :
$$ c=\frac {2L}{T_1} \tag {1},$$ where $T_1$ is tick duration in photon clock reference frame.
According to B) photon travels per 1 tick distance $2x$, so by outside observer photon speed is : $$ c= \frac {2x}{T_2}, \tag {2}$$ Where $T_2$ is time duration of 1 tick as is seen from outside reference frame.
Now because light speed is the same in all reference frames, we can equate :
$$ \frac {2L}{T_1} = \frac {2x}{T_2} \tag 3 $$
According to Pythagoras theorem, $$ x= \sqrt{L^2+l^2} \tag 4 $$
Substituting (4) into (3), and expressing tick duration ratios, we get :
$$ \frac {T_2}{T_1} = \frac {\sqrt{L^2+l^2}}{L} \tag 5$$
Multiplying in RHS numerator and denominator by $1/L$ we get :
$$ \frac {T_2}{T_1} = \sqrt {1 + \frac {l^2}{L^2}} \tag 6$$
Acknowledging that $l$ is distance traveled of photon clock moving forward with speed $v$ per half of proper tick $T_1/2$, and similarly - $L$ is distance traveled by photon in own reference frame per same half of proper tick. So we can re-write (6) into :
$$ \frac {T_2}{T_1} = \sqrt {1 + \frac {(v~T_1/2)^2}{(c~T_1/2)^2}} \tag 7 $$
After simplification (7) becomes,
$$ \frac {T_2}{T_1} = \sqrt {1 + \frac {v^2}{c^2}} \tag 8 $$
What I've got is "something a bit like" a Lorentz factor. From the wiki is seems that there's an alternative forms of Lorentz factor like : $$ \gamma ={\sqrt {1+\left({\frac {p}{m_{0}c}}\right)^{2}}} \tag 9,$$
but I'm not sure if equation (8) can be reduced to (9) or vise-versa. So it's more probably that I've made an error somewhere in derivation or in concepts/ schematics.
Question is,- Does (8) equation valid and if not - Where I have made an error and How to derive correct Lorentz factor for time dilation from a moving photon clock ?