Closed inodentry closed 2 years ago
Done! To be included in the next release.
Implemented the Parallelogram shape, which supports arbitrary parallelograms (including rotated rectangles).
Rectangular parallelograms can be constructed using the Parallelogram::rectangle
helper method.
Also implemented the Rotate trait, which enables Polygons, Circles, Capsules, and Parallelograms to be rotated via the rotate
method. If doing multiple rotations by the same angle, you can use the rotate_sincos
method to avoid re-computing the sine and cosine multiple times.
It would be nice and convenient to have a rectangle shape that can be rotated. Could be easier to use and more efficient than trying to use Polygon for this use case.