Skip to content

[math] implement genvector custom axis rotation #18462

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ferdymercury
Copy link
Contributor

This Pull request:

Changes or fixes:

Fixes https://root-forum.cern.ch/t/tvector3-rotate-to-arbitrary-rotation-using-xyzvector/63244

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@ferdymercury ferdymercury requested a review from mdessole April 22, 2025 13:24
Copy link

github-actions bot commented Apr 22, 2025

Test Results

    15 files      15 suites   3d 9h 2m 10s ⏱️
 2 703 tests  2 703 ✅ 0 💤 0 ❌
40 100 runs  40 100 ✅ 0 💤 0 ❌

Results for commit 24cc921.

♻️ This comment has been updated with latest results.

@ferdymercury ferdymercury marked this pull request as ready for review April 22, 2025 16:23
@ferdymercury ferdymercury requested a review from lmoneta as a code owner April 22, 2025 16:23
@ferdymercury ferdymercury added this to the 6.38.00 milestone Apr 22, 2025
@@ -332,6 +338,38 @@ namespace ROOT {
vrot.SetXYZ(x2, y2, v.Z());
return vrot;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

why not implementing an access operator in the Rotation3D class instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

see e.g. #18480

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Monica for the swift review.
Wrt using the Rotation3D class: It's maybe a bit less efficient to define an AxisAngle, then a TRotation3D, and finally calling Rotate, than doing the direct multiplication?

Copy link
Contributor

Choose a reason for hiding this comment

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

You have a point. However, I agree with the author of the forum post you mentioned, it's counter-intuitive that a TRotation3D does not work with Rotate...

@mdessole mdessole self-requested a review April 24, 2025 13:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants