Java rotation of pixel array
问题 I have tried to make an algorithm in java to rotate a 2-d pixel array(Not restricted to 90 degrees), the only problem i have with this is: the end result leaves me with dots/holes within the image. Here is the code : for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { int xp = (int) (nx + Math.cos(rotation) * (x - width / 2) + Math .cos(rotation + Math.PI / 2) * (y - height / 2)); int yp = (int) (ny + Math.sin(rotation) * (x - width / 2) + Math .sin(rotation + Math.PI / 2) *