Repository navigation
Add Mat44 affine reflection and shear constructors - #65
Merged
Merged
Conversation
crertel
force-pushed
the
44-mat44-transforms
branch
from
September 16, 2026 04:44
7f5ca00 to
967e07b
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
Mat44.make_reflect/2andmake_shear_x/2,make_shear_y/2, andmake_shear_z/2for 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 raisesArithmeticError. 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 intransform_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
0and0.0offsets), 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.