stacker.residue_movement.correct_theta_sign#
- correct_theta_sign(rho, y_axis, theta)[source]#
Corrects the sign of an angle theta with the x-axis within a plane defined by a given y-axis.
When calculating the angle theta between two vectors in 3D space, once the vectors move >180 degrees apart, the angle becomes the shortest path. To have 360 degrees of freedom, we calculate theta within the plane by checking if it faces the same direction as a vector y, and correcting otherwise.
- Parameters:
- rhoVector
The vector compared to the x-axis to form theta.
- y_axisVector
Directional vector to define a plane with x-axis; orthogonal to x-axis.
- thetafloat
The calculated angle of rho with x-axis to be corrected.
- Returns:
- float
Theta as calculated on the plane.