Java program affine transformation