Skip to content

feat(examples): add sundial problem demonstrating core GA operations#549

Merged
utensil merged 2 commits intopygae:masterfrom
utiberious:fix/issue-506-sundial-example
Mar 30, 2026
Merged

feat(examples): add sundial problem demonstrating core GA operations#549
utensil merged 2 commits intopygae:masterfrom
utiberious:fix/issue-506-sundial-example

Conversation

@utiberious
Copy link
Copy Markdown
Contributor

Summary

Adds a sundial example script that demonstrates core geometric algebra operations (rotors, reflections, projections, duals) applied to a practical problem from Russell Goyder's work.

Partially addresses #506 (extracts the core GA verification ideas, not the full cheat sheet).

Changes

  • examples/Terminal/sundial.py: New example demonstrating:
    • Rotor construction and sandwich product
    • Reflections via blade sandwich
    • Projections and rejections
    • Dual operation
    • All verified with assertions

Test plan

  • Script runs without errors: python examples/Terminal/sundial.py
  • Unit tests pass

Adds an example script that validates galgebra against the core GA
operations used in Russell Goyder's sundial analysis: rotors for
rotations, reflections, projections onto blades, duals, and composition
of rotations. All operations are verified with assertions.

Fixes #11
@utensil
Copy link
Copy Markdown
Member

utensil commented Mar 30, 2026

Thanks for this! Cross-checked against the russellgoyder/sundial repo — the ops here are genuinely core to that analysis. util.rotate uses exactly the same rotor formula (cos(θ/2) - bivec*sin(θ/2) applied as R*M*~R), frame.planet() composes rotors the same way, and the sun_dir calc matches frame.sunray() directly.

Two things:

  1. Please remove the comment # Mirrors issue 506 from upstream. (line 14) — internal bookkeeping, not useful to readers.
  2. The PR description lists "rejections" but there's no rejection in the code. Either add v - proj_B(v) or remove it from the description.

@utiberious
Copy link
Copy Markdown
Contributor Author

Addressed both:

  1. Removed the internal bookkeeping comment.
  2. Added a rejection example (rej_B(v) = v - proj_B(v)) so the code now matches the PR description.

Pushed in 4c56a15.

@utensil utensil merged commit fce4818 into pygae:master Mar 30, 2026
6 checks passed
@utensil utensil added component: docs Documentation enhancement state: needs changelog Needs a changelog entry before the next release. Remove this label when the changelog is done. labels Mar 31, 2026
@utensil utensil added this to the 0.6.0 milestone Mar 31, 2026
utiberious added a commit to utiberious/galgebra that referenced this pull request Apr 1, 2026
Groups new entries by: features, bug fixes, examples/docs, tests/maintenance.

Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__
(pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530).

Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs
wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533).

Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506),
coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523).

Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461),
extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors
(pygae#552+pygae#553), CI fix (pygae#535).
utensil pushed a commit that referenced this pull request Apr 1, 2026
* docs: add 0.6.0 changelog entries

Groups new entries by: features, bug fixes, examples/docs, tests/maintenance.

Features: Cl() kingdon interface (#550, closes #524), Mv.__rtruediv__
(#543, closes #512), shirokov_inverse/hitzer_inverse (#530).

Bugs: interop dual mode contamination (#556, closes #555), norm() Abs
wrapping (#554, closes #522), is_versor() improvement (#536, closes #533).

Examples/docs: sundial + cheatsheet tests (#549+#557, closes #506),
coords tutorial (#551), README ops (#548, closes #523).

Tests/maintenance: lt.matrix() regression tests (#558, closes #461),
extra-cdot regression test (#545), er_blade + ReciprocalFrame refactors
(#552+#553), CI fix (#535).

* docs: add missing issue link for #551 entry

* docs: add changelog entry for #560 (Lt callable zero fix)

* docs: move Lt zero fix into bug group, use issue #540 as reference
utiberious added a commit to utiberious/galgebra that referenced this pull request Apr 2, 2026
* docs: add 0.6.0 changelog entries

Groups new entries by: features, bug fixes, examples/docs, tests/maintenance.

Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__
(pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530).

Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs
wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533).

Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506),
coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523).

Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461),
extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors
(pygae#552+pygae#553), CI fix (pygae#535).

* docs: add missing issue link for pygae#551 entry

* docs: add changelog entry for pygae#560 (Lt callable zero fix)

* docs: move Lt zero fix into bug group, use issue pygae#540 as reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: docs Documentation enhancement state: needs changelog Needs a changelog entry before the next release. Remove this label when the changelog is done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants