Special Relativity: Spacetime Diagrams

I'm having some confusion understanding the basic idea of a spacetime diagram and what it really shows. Here is (hopefully) a diagram representing two frames, S and S', where S' moves at relative velocity u to S.

http://i32.tinypic.com/mlrywg.png

Now, I'm fine with tan(theta) = u/c, since S' moves at velocity u, x = ut gives the blue ct' line.

P happens when x'=0, t'=T'

Inverse Lorentz transform says t = T = gamma[u](t' + vx'/(c^2)) = gamma[u]*T'

I'm taking this to mean that the t-coord in S, of event P, is given by this relation.

tan(theta) = u/c => gamma[u] = [1 - tan^2(theta)]^-1/2

Hence T = T'*[1 - tan^2(theta)]^-1/2

However, using basic trig on the right-angled triangle:

T = T'*cos(theta)

cos(theta) does not equal [1 - tan^2(theta)]^-1/2 !