Rotation with three shears
Hah! Author of that 20-year-old web page here.At the time I was attempting to use standard open source image processing software like ImageMagick to manipulate scientific data. I was disappointed to find that it was not suitable, both due to approximations like this one, and because all the libraries I looked at only allowed 8-bit grayscale. I really wanted floating point data.Here is what I was working on back in those days: https://www.ocf.berkeley.edu/~fricke/projects/israel/project...I was a summer student at the Weizmann Institute of Science in Rehovot, Israel, processing electron micrographs of a particular protein structure made by a particular bacterium. It's very interesting: this bacterium attacks plants and injects some genetic material into the plant, causing the plant to start manufacturing food for the bacterium. By replacing the "payload" of this protein structure, the mechanism can be used to insert other genetic structures into the plant, instead of the sequence that causes it to produce food for the bacterium. Or something like that.Here's a random chunk of my research journal from those days: https://www.ocf.berkeley.edu/~fricke/projects/israel/journal...The work contributed to this paper: https://www.jbc.org/article/S0021-9258(20)66439-0/fulltextHere's the Wikipedia article about the author of that algorithm: https://en.wikipedia.org/wiki/Alan_W._PaethAnd his original web page that I linked to, now via archive.org: https://web.archive.org/web/20050228223159/http://people.ouc...If you liked this trick, check out Alan Paeth's "Graphics Gems" series of books.Kudos and thanks to the OCF at UC Berkeley which has hosted my web page there for more than a quarter century with just about zero maintenance on my part.And thanks for the trip down memory lane!