How can I rotate a 3d array (nxnxn) by x degrees around x, y, and z axes?
问题 I have a 3d array created with numpy, and I was wondering how I can rotate it by a custom angle, not just the rot90 function that numpy has. Can anyone help? The 3d matrix represents an image (such as a cube, or some other shape) ie 0: 1 1 1 1 1 1 1 1 1: 1 1 1 1 2: 1 1 1 1 1 1 1 1 EDIT: Moved solution to answer 回答1: Have a look at the scipy.ndimage.interpolation.rotate function. The reason this is in scipy and not in numpy is that rotating an image 90 degrees is done by just chaning the