Repository navigation
Add explicit 2D and 3D Mat33 reflection and shear constructors - #64
Merged
Merged
Conversation
crertel
force-pushed
the
44-mat33-transforms
branch
from
September 16, 2026 04:26
5a0d875 to
c9a2a9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Mat33 reflection and shear constructors whose names distinguish 2D affine transforms from 3D linear transforms:
make_reflect_2d/2,make_shear_x_2d/1, andmake_shear_y_2d/1preserve the homogeneous coordinate. Apply them withtransform_point/2ortransform_vector/2.make_reflect_3d/1andmake_shear_x_3d/2,make_shear_y_3d/2, andmake_shear_z_3d/2use all three spatial coordinates. Apply them withapply_left/2.The 2D reflection accepts a line normal and its equation constant, so the mirror can be offset from the origin. The 3D reflection mirrors across a plane through the origin. Normals need not have unit length; zero normals raise
ArithmeticError. All constructors retain float typespecs and explicit float clauses with numeric fallbacks.Module and transform docs explain the coordinate distinction, translation behavior, and row-vector convention.
Validation: 535 tests and 3 doctests pass with 100% line coverage after rebasing onto master with #62 and #63 merged. New tests cover offset mirrors, unchanged directions, normal scaling, reflection invariants, every shear axis, inverses, fractional and mixed inputs, composition with translation, and homogeneous versus spatial third coordinates. Formatting, compilation with warnings as errors, and documentation generation pass.
Part of #44.