# Euler angles vs. simple z-rotation: different results?

**URL:** <https://root-forum.cern.ch/t/euler-angles-vs-simple-z-rotation-different-results/56107>\
**Category:** ROOT\
**Tags:** math\
**Created:** [August 22, 2023, 3:50pm UTC](https://root-forum.cern.ch/t/euler-angles-vs-simple-z-rotation-different-results/56107 "2023-08-22T15:50:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerritzen](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/gerritzen/32/34151_2.png) [@gerritzen](https://root-forum.cern.ch/u/gerritzen)\
**Post date:** [August 22, 2023, 3:50pm UTC](https://root-forum.cern.ch/t/euler-angles-vs-simple-z-rotation-different-results/56107/1 "2023-08-22T15:50:42Z")

</div>

Hi,

I was looking at the Euler angle convention used in ROOT:

> The so-called “x-convention,” illustrated above, is the most common definition. In this convention, the rotation given by Euler angles (phi,theta,psi), where
> 
> 1. the first rotation is by an angle phi about the z-axis using D,
> 
> 2. the second rotation is by an angle theta in [0,pi] about the former x-axis (now x’) using C, and
> 
> 3. the third rotation is by an angle psi about the former z-axis (now z’) using B.

Based on that, I expected a rotation by (phi = 0.1, 0, 0) and (0, 0, psi = 0.1) to be identical to just a rotation about z.

```auto
root [0] ROOT::Math::XYZVector x(1,0,0);
root [1] ROOT::Math::EulerAngles r1(0.1,0,0);
root [2] ROOT::Math::EulerAngles r2(0,0,0.1);
root [3] ROOT::Math::RotationZ rz(0.1);
root [4] std::cout << rz * x << std::endl;
(0.995004,0.0998334,0)
root [5] std::cout << r1 * x << std::endl;
(0.995004,-0.0998334,0)
root [6] std::cout << r2 * x << std::endl;
(0.995004,-0.0998334,0)

```

I expected three times the first output. Did I misinterpret the definition?

* * *

_ROOT Version:_ 6.28/00; 6.28/04  
_Platform:_ Linux; macOS  
_Compiler:_ -

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [August 22, 2023, 3:58pm UTC](https://root-forum.cern.ch/t/euler-angles-vs-simple-z-rotation-different-results/56107/2 "2023-08-22T15:58:45Z")

</div>

Welcome to the ROOT forum.

I guess @moneta can help you.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [September 5, 2023, 3:58pm UTC](https://root-forum.cern.ch/t/euler-angles-vs-simple-z-rotation-different-results/56107/3 "2023-09-05T15:58:46Z")

</div>

Closed on September 5, 2023, 3:58pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
