The 2D part is due to the touch screen coordinates. However, my rotation matrix is for manipulating 3D vertices, where the angle theta is required. It's a touchscreen FPS app after all.
I need to find the angle from the X axis to the red line. I don't understand how (cos(angle), sin(angle) = normalized(P2-P1) when the angle is arbitrary in the range 0 degrees to 90 degrees. Unless you mean that for given P1 and P2, by doing arccosine and arcsine on the normalized X and Y of the vector, I can obtain the angle?