pdf-raku / PDF-Content-raku

Basic PDF content editing and rendering support, including text, images, fonts and general graphics
Artistic License 2.0
2 stars 3 forks source link

Matrix seems to be missing a "reflect" method #11

Closed tbrowder closed 3 years ago

tbrowder commented 3 years ago

My matrix algebra is very sketchy now since I haven't had to use it in years. But I am trying to compose a reflection followed by a rotation for a special method where a scaling followed or preceeded by a rotation doesn't give the expected or desired results. I found a Wikipedia article entitled Rotations and reflections in two dimensions which mathematically composes the two required transformations into a single reflection.

UPDATE

There is a slight difference in signs in the article versus those in Matrix.rakumod which seem to be whether a positive rotation is clockwise or counterclockwise. I am working on a PR. I've changed signs in my PR to go with the PDF::Content convention and the tests I've added seem to work.

dwarring commented 3 years ago

Merged with PR https://github.com/pdf-raku/PDF-Content-raku/pull/12