I'm learning electrostatics right now and just had a quick problem that involved calculating the electric field at a test point z units above the $x$ axis due to $2$ equal charges separated by equal distance $\frac{d}{2}$ from the origin along the x axis in either direction. Now, I felt like I understood the procedure, however upon completing the problem and looking at the solution I see I've mixed up my trig factors because I defined my $\theta$ in the wrong vertex. My question is: How am I, in general, supposed to know where to define my $\theta$ from when calculating components of forces or fields between $2$ points? I will show a picture of the setup, my interpretation of the setup and then the correct one below and then quickly explain my reasoning so that someone may correct it.
Where $\theta_1$ is the angle I used to calculate my components of the electric field and $\theta_2$ is the correct angle.
Now the reason I drew my angle in that bottom vertex is the separation vector in the book (Griffiths Electrodynamics) is defined as: $$R = r - r'$$ Where $r$ is the vector pointing from the origin to the test charge $Q$ and $r'$ is the vector pointing from the origin to the source charge $q$. Therefore, the separation vector points from the source charge $q$ to the test charge $Q$. My thinking was that if the separation vector has positive direction pointing "up" the hypotenuse of both right triangles then it would only make sense to define the relevant angle for calculating components of the electric field would be the one I selected, $\theta_1$.
However, that is not the case and I don't see why. To me it almost seems arbitrary, and I would really appreciate an explanation as to why the components of the electric field are calculated with respect to the top angle $\theta_2$. More generally, how does one know which non-right angle to define as the relevant angle for calculating components of force, or really vectors?
Thanks for any help rendered!
My solution
For this setup utilizing $\theta_1$ I determined $R = \sqrt{z^2 + (\frac{d}{2})^2}$ and noted the symmetry in the horizontal direction will yield net $0$ electric field since both charges are equal and the same horizontal distance away just in different directions thus we would have $$E_{\text{horiz}} = \frac{1}{4\pi\epsilon_0}\frac{q}{R^2}\cos\theta_1(\hat{x} + (-\hat{x})) = 0$$Now for the vertical component of the electric field we have $$E_{\text{vert}} = \frac{1}{4\pi\epsilon_0}\frac{q}{R^2}\sin\theta_1(\hat{z} + \hat{z}) = \frac{1}{4\pi\epsilon_0}\frac{q}{R^2}\left(\frac{z}{R}\right)(2\hat{z}) = \frac{1}{4\pi\epsilon_0}\frac{2qz}{\left(z^2 + (\frac{d}{2})^2\right)^{\frac{3}{2}}}\hat{z}$$
