I am new to SE Mathematica, and search gives no answer; so here is my problem:
During the testing of my numerical library for quaternions with Mathematica (package Quaternions) I observed the following behavior:
<<Quaternions`
a = Quaternion[1, 2, 3, 4]
(* Quaternion[1, 2, 3, 4] *)
b = N[ArcCos[a]]
(* Quaternion[1.390115947, -0.8918751006, -1.337812651, -1.783750201] *)
Cos[b]
(* Quaternion[1., -2., -3., -4.] *)
i.e. the vector part is negated. I can reproduce the result for ArcCos
,
but my code gives Cos[b] = [1, 2, 3, 4]
(also given by the quaternion postfix calculator). This is not a rounding problem, and not limited to this specific quaternion. The same happened for e.g. Cot[ArcCot[a]
, where as the following is as I would expect:
b = N[ArcSin[a]]
(* Quaternion[0.1806803802, 0.8918751006, 1.337812651, 1.783750201] *)
Sin[b]
(* Quaternion[1., 2., 3., 4.] *)
My first guess was that it is related to branch cuts, but the analog complex functions give the expected result Cos[ArcCos[1 + 2*I]] = 1 + 2*I
.
Question: What is the explanation for the negated vector part for some trigonometric quaternion functions like $\cos$, $\cot$, etc.?
Quaternion[1.390115947,-0.8918751006,-1.337812651,-1.783750201]
i.e. the same asArcCos[a]
. $\endgroup$AbsIJK
. I believe the definitionAbsIJK[a_?NumericQ] := Im[a]
should beAbsIJK[a_?NumericQ] := Abs[Im[a]]
, given that's what the other definition ofAbsIJK
does. I can file an internal report for this. $\endgroup$FullSimplify[ArcCos[z] + ArcCos[-z]] = Pi
but even with your change I get for the essentially complex quaterniona=[1,2,0,0]
the valueArcCos[a] + ArcCos[-a]] = [3.141592653589793, 3.057141838961996, 0., 0.]
$\endgroup$