5

I would like to determine Euler angles according to the following example.

My example:

I have the three vectors in an original set of axes:

r1e = {-0.517853, 0., -0.759239}
r2e = {-0.517853, 0., 0.759239}
r3e = {0.0647316, 0., 0.}

And after expressing them in a new reference frame they obtain the following components:

rt1e={0.310733, -0.358839, -0.786917}
rt2e={0.690333, 0.298661, 0.527983}
rt3e={-0.0625667, 0.00376111, 0.0161833}

In reality, I know the Euler angles to be $(30,60,120)$ degrees. How can I get Mathetmatica to give me this?

  • Have you tried EulerAngles? – Henrik Schumacher Jan 06 '19 at 18:09
  • That command won't work, as the rotation matrix itself is not known. Only the two vectors. – Spherical Cow Jan 06 '19 at 18:10
  • 1
    In general, a rotation matrix is not uniquely defined by the action on a single vector... – Henrik Schumacher Jan 06 '19 at 18:12
  • Fair enough, but in this case the problem has been constructed such that the three Euler angles are known to exist. The question specifically relates to why NSolve is not working. – Spherical Cow Jan 06 '19 at 18:14
  • 1
    What I tried to say: If you prescribe a pair $u$ and $v$ of same length $\neq 0$ in $\mathbb{R}^3$, then there will be a one-parameter family of rotations (and thus a one-parameter family of Euler angles) that map $u$ to $v$. So, it is as it is: Your problem is underdetermined. – Henrik Schumacher Jan 06 '19 at 18:18
  • Ah, now, I see it: In NSolve, you use r1te which is undefined. You have to replace it with rt1e. Then NSolve will do something but it runs and runs and does not return anything. Probably because NSolve assumes that the equation is sufficiently nondegenareate so that Newton's method can be applied. But this assumptions is violated here because there is a one-parameter family of solutions, something, that an unprepared Newton method is not able to cope with. – Henrik Schumacher Jan 06 '19 at 18:22
  • Please see edits to the problem statement. I actually have 3 vectors available and want to determine the Euler angles defining the change of coordinate frame between them. – Spherical Cow Jan 06 '19 at 18:27
  • 1
    "I actually have 3 vectors" - by this, do you mean the three vectors before and after being transformed by some rotation matrix? If so, please look at FindGeometricTransform[], which can be used with EulerAngles[]. – J. M.'s missing motivation Jan 06 '19 at 18:29
  • Yes, see the edits added now. Thanks. – Spherical Cow Jan 06 '19 at 18:30
  • There's a similar problem here. – A little mouse on the pampas Apr 05 '20 at 02:14

1 Answers1

11

As noted, you can use FindGeometricTransform[] in tandem with EulerAngles[]:

r = {{-0.517853, 0., -0.759239}, {-0.517853, 0., 0.759239}, {0.0647316, 0., 0.}};
rt = {{0.310733, -0.358839, -0.786917}, {0.690333, 0.298661, 0.527983},
      {-0.0625667, 0.00376111, 0.0161833}};

fg = FindGeometricTransform[r, rt];

EulerAngles[Drop[TransformationMatrix[Last[fg]], -1, -1]]/°
   {60.0048, 30.0019, 120.}
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574