Skip to content

Comments

Add matrix.transform-rotate-aer (azimuth/elevation/roll) helper#1034

Merged
johannes-wolf merged 2 commits intocetz-package:masterfrom
RaulDurand:feature/transform-rotate-aer
Feb 23, 2026
Merged

Add matrix.transform-rotate-aer (azimuth/elevation/roll) helper#1034
johannes-wolf merged 2 commits intocetz-package:masterfrom
RaulDurand:feature/transform-rotate-aer

Conversation

@RaulDurand
Copy link
Contributor

This PR adds a convenience rotation constructor to matrix:

transform-rotate-aer(azimuth, elevation, roll: 0deg)

Behavior

  • Builds a 4x4 rotation matrix from azimuth/elevation with optional roll.
  • Uses the viewing convention:
    • z points up
    • x points toward the viewer
    • aligned with the common azimuth/elevation camera interpretation used by plotting tools (including matplotlib).
  • Optional roll around the current viewing axis after azimuth/elevation.

Implementation

  • Added internal helper:
    • _rotate-axis-angle(ax, ay, az, angle) (axis-angle rotation matrix using the Rodrigues' formula)
  • Added public function:
    • transform-rotate-aer(azimuth, elevation, roll: 0deg)

Copy link
Member

@johannes-wolf johannes-wolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, otherwise fine.

@johannes-wolf johannes-wolf merged commit d573cad into cetz-package:master Feb 23, 2026
1 check passed
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