Skip to content

Add Vec4 and explicit homogeneous point and direction constructors - #62

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

crertel merged 1 commit into
masterfrom
44-vec4

Conversation

@crertel

@crertel crertel commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Add Graphmath.Vec4 with four-component constructors, arithmetic, dot products, norms, normalization, interpolation, projection, and comparisons. Float typespecs and float-specialized clauses follow the existing vector modules, with numeric fallbacks and direct tuple arithmetic.

from_point3/1 and from_direction3/1 make homogeneous intent explicit by setting w to 1.0 and 0.0. Docs and tests show that Mat44 translation moves points while leaving directions unchanged, and explain that four-dimensional normalization is distinct from dividing by the homogeneous coordinate.

Part of #44.

Validation: 26 new tagged tests and 2 doctests cover integer/float/mixed inputs, all four components, independent arithmetic results, equality/distance boundaries, zero errors, and homogeneous point/direction behavior. The full suite passes with 511 tests and 3 doctests, and library coverage remains 100%. Formatting, warnings-as-errors compilation, documentation generation, and diff checks pass.

@coveralls

Copy link
Copy Markdown

Coverage Status

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

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

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

@coveralls

Copy link
Copy Markdown

Coverage Status

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

@crertel
crertel merged commit 94b6146 into master Sep 16, 2026
4 checks passed
@crertel
crertel deleted the 44-vec4 branch September 16, 2026 04:20
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