Skip to content

Normalize the axis in UnitQuaternion.AngVec - #266

Open
wpyaoxueros wants to merge 1 commit into
rai-opensource:masterfrom
wpyaoxueros:codex/fix-angvec-axis-normalization
Open

wpyaoxueros wants to merge 1 commit into
rai-opensource:masterfrom
wpyaoxueros:codex/fix-angvec-axis-normalization

Conversation

@wpyaoxueros

Copy link
Copy Markdown

UnitQuaternion.AngVec(0.5, [1, 2, 3]) currently produces a quaternion with norm greater than one and a matrix that is not the requested rotation. Normalize a nonzero-angle axis before constructing the quaternion, while preserving the documented identity result for zero angle (including a zero axis). A nonzero angle with a zero axis raises ValueError, consistently with the base angle-axis rotation constructor.

Adds regression coverage for norm, angle/axis round-trip, matrix agreement, degrees, unit-axis controls, and zero-angle/zero-axis behavior.

Validation on Python 3.11:

  • New regressions against unchanged master: 5 failed, 3 passed; after the fix: 8 passed.
  • Full suite: 410 passed, 11 skipped (55 subtests passed).
  • Project-pinned Black 23.10.0 and git diff --check passed.

AI assistance: an AI coding agent helped investigate, implement, test, and review this change. No independent human review is claimed.

This branch has not been deployed

No deployments
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.

1 participant