Skip to content

Add Mat44 affine reflection and shear constructors - #65

Merged
crertel merged 3 commits into
masterfrom
44-mat44-transforms
Sep 16, 2026
Merged

crertel merged 3 commits into
masterfrom
44-mat44-transforms

Conversation

@crertel

@crertel crertel commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Adds Mat44.make_reflect/2 and make_shear_x/2, make_shear_y/2, and make_shear_z/2 for 3D affine transformations. All constructors preserve the fourth, homogeneous coordinate and use the library's row-vector convention.

Reflection accepts a nonzero plane normal and the equation constant in nx*x + ny*y + nz*z = offset. The normal need not have unit length; a zero normal raises ArithmeticError. Offset reflections translate points while directions receive only the linear reflection. Each shear changes its named axis using the other two spatial coordinates.

Module and transform docs explain points (w = 1), directions (w = 0), and the absence of perspective division in transform_point/2. All constructors retain float typespecs and explicit float clauses with numeric fallbacks.

Validation: 552 tests and 3 doctests pass with 100% line coverage after rebasing onto master with #62, #63, and #64 merged. Tests cover coordinate and oblique planes (including both 0 and 0.0 offsets), normal/offset scaling, reflection invariants, homogeneous coordinates, every shear axis, inverses, composition order, translation, and fractional/mixed inputs. For zero offsets, X, Y, Z, and oblique normals all exercise integer, float, and mixed inputs, with checks for fixed points, no translation, expected point/direction results, and preservation of the homogeneous coordinate. Formatting, compilation with warnings as errors, and documentation generation pass.

Part of #44.

@coveralls

Copy link
Copy Markdown

Coverage Status

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

@coveralls

coveralls commented Sep 16, 2026 •

Copy link
Copy Markdown

Coverage Status

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

@crertel
crertel force-pushed the 44-mat44-transforms branch from 7f5ca00 to 967e07b Compare September 16, 2026 04:44
@crertel
crertel merged commit 805739e into master Sep 16, 2026
4 checks passed
@crertel
crertel deleted the 44-mat44-transforms branch September 16, 2026 05:25
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