I'm quoting from the Feynman Lectures:
"Assume that Moe’s axes have rotated relative to Joe’s by an angle θ. The two coordinate systems are shown in Fig. 11-2, which is restricted to two dimensions. Consider any point P having coordinates (x, y) in Joe’s system and (x′, y′) in Moe’s system. We shall begin, as in the previous case, by expressing the coordinates x′ and y′ in terms of x, y, and θ. To do so, we first drop perpendiculars from P to all four axes and draw AB perpendicular to PQ. Inspection of the figure shows that x′ can be written as the sum of two lengths along the x′-axis, and y′ as the difference of two lengths along AB. All these 11-3 lengths are expressed in terms of x, y, and θ in equations (11.5), to which we have added an equation for the third dimension. x′ = x cos θ + y sin θ, y′ = y cos θ − x sin θ, z′ = z." Here is the figure:
How to prove x′ = x cos θ + y sin θ & y′ = y cos θ − x sin θ?