Skip to content

Add explicit 2D and 3D Mat33 reflection and shear constructors - #64

Merged
crertel merged 1 commit into
masterfrom
44-mat33-transforms
Sep 16, 2026
Merged

crertel merged 1 commit into
masterfrom
44-mat33-transforms

Conversation

@crertel

@crertel crertel commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

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, and make_shear_y_2d/1 preserve the homogeneous coordinate. Apply them with transform_point/2 or transform_vector/2.
  • make_reflect_3d/1 and make_shear_x_3d/2, make_shear_y_3d/2, and make_shear_z_3d/2 use all three spatial coordinates. Apply them with apply_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.

@coveralls

coveralls commented Sep 16, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — 44-mat33-transforms into master

@crertel
crertel force-pushed the 44-mat33-transforms branch from 5a0d875 to c9a2a9f Compare September 16, 2026 04:26
@crertel
crertel merged commit 88ba269 into master Sep 16, 2026
4 checks passed
@crertel
crertel deleted the 44-mat33-transforms branch September 16, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants