Two spaceships A and B are approaching along perpendicular directions, as seen from earth. If A is observed by a stationary Earth observer to have velocity $_$ = -0.90c and B to have velocity $_$ = +0.90c, determine the speed of ship A as measured by the pilot of ship B.
To solve the problem, I split it into two parts: first part for the $x$ component the velocity of A, and second part for the $y$ component. Let $v$ and $v'$ be the velocities of ship A in frame S and S' respectively. Similarly, let $w$ and $w'$ be the velocities for ship B. We set frame S to be attached to Earth while S' is attached to spaceship B. From Lorentz' velocity transformation formula, $$v_x'=\dfrac{v_x-w_x}{1-\dfrac{v_xw_x}{c^2}}=-w_x=-0.9c$$ since $v_x=0$. Similarly for $v_y$, $$v_y'=\dfrac{v_y-w_y}{1-\dfrac{v_yw_y}{c^2}}=v_y=-0.9c$$ since $w_y=0$. Then I used Pythagoras' Theorem to obtain the total velocity of ship A, and...well here's the result: $v=\sqrt{v_x^2+v_y^2}\approx 1.273c$
At this point, I think my problem clear. As we know, nothing can exceed the speed of light, so it is not possible for ship A to be travelling at a speed higher than $c$. What did I do wrong in my steps? Every example I found online was one-dimensional. I looked for answers on this website, and I found mixed answers more confusing than the problem itself. I'm suspecting that my mistake lies in the assumption that Pythagora's Theorem holds for relativistic velocities. Help, please?