Reciprocal to angular coordinates

Transformation (Qx, Qz)→(θ1, θ2). Note: it uses the global value |||VelkeK| = $\displaystyle {\frac{{2\pi}}{\lambda}}$. */

void Theta1Theta2_from_QxQz ( double& Theta1, double& Theta2, double Qx, double Qz) if (Qz==0) Theta1=Theta2=0; return; double sigma, delta; if (RecSpaceNearOriginApprox) /*+ θ1 = ${\frac{{Q_z}}{{2K}}}$ + ${\frac{{Q_x}}{{Q_z}}}$      θ2 = ${\frac{{Q_z}}{{2K}}}$ - ${\frac{{Q_x}}{{Q_z}}}$ */ sigma = Qz/(2*VelkeK); delta = Qx/Qz; Theta1=sigma+delta; Theta2=sigma-delta; else /*+ θ1 = $\atan$${\frac{{Q_x}}{{Q_z}}}$ - $\asin$${\frac{{\vert Q\vert}}{{2K}}}$      θ2 = $\atan$${\frac{{Q_x}}{{Q_z}}}$ + $\asin$${\frac{{\vert Q\vert}}{{2K}}}$ */ sigma = asin ( sqrt( Qx*Qx+Qz*Qz ) / (2*VelkeK) ); delta = atan ( Qx/Qz ); Theta1=sigma-delta; Theta2=sigma+delta; ;

//- eof AngRecSp.cpp

/*