I have a segment constructed of several voxels of 3D coordinates. My aim is to to rotate it so as it becomes colinear with the Z-axis. For this, I compute the angle between