initial version (.1)
actually calculate transformation (.2)
x/y flipping, force rescaling, file output (.3)