You can use the 4 x 4 transformation matrix, which is invertible and allows bidirectional transformation between the two coordinate systems you want.
If you know the three turns a , b and g , about x , y , z respectively, using the right rule. x0 , y0 , z0 are translations between the sources of two coordinate systems.
The transformation matrix is ββdefined as:
T = np.array([[ cos(b)*cos(g), (sin(a)*sin(b)*cos(g) + cos(a)*sin(g)), (sin(a)*sin(g) - cos(a)*sin(b)*cos(g)), x0], [-cos(b)*sin(g), (cos(a)*cos(g) - sin(a)*sin(b)*sin(g)), (sin(a)*cos(g) + cos(a)*sin(b)*sin(g)), y0], [ sin(b), -sin(a)*cos(b), cos(a)*cos(b), z0] [ 0, 0, 0, 1])
To use it effectively, you must put your points in a two-dimensional array, for example:
orig = np.array([[x0, x1, ..., xn], [y0, y1, ..., yn], [z0, z1, ..., zn], [ 1, 1, ..., 1]])
Then:
new = T.dot(orig)
will give you converted points.