Mathematica can easily compute exponentials and logarithms of concrete quaternions:
Needs["Quaternions`"]
Exp[Quaternion[1.3, 3.5, -0.7, 0.9]]
Log[Quaternion[1.3, 3.5, -0.7, 0.9]]
Quaternion[-3.14824, -1.79206, 0.358412, -0.460816] Quaternion[1.36196, 1.17075, -0.23415, 0.301051]
Even for exact numbers:
Exp[Quaternion[1, 3, 7/2, -5]]
Quaternion[E Cos[Sqrt[185]/2], (6 E Sin[Sqrt[185]/2])/Sqrt[185], (7 E Sin[Sqrt[185]/2])/Sqrt[185], -2 Sqrt[5/37] E Sin[Sqrt[185]/2]]
But it seems to be unable to expand this for the general quaternion:
Exp[Quaternion[a, b, c, d]]
E^Quaternion[a, b, c, d]
I've tried using Simplify
, FunctionExpand
, ToQuaternion
on this, but still it doesn't give a Quaternion
object. But there exists a closed form for such functions.
I can, of course, define such functions myself, like:
exp[q_] = With[{v = q - Re[q]}, Exp[Re[q]] (Cos[Abs[v]] + v/Abs[v] Sin[Abs[v]]) ];
ln[q_] = Log[Abs[q]] + (q - Re[q])/AbsIJK[q] ArcCos[Re[q]/Abs[q]];
But is there a way to get Mathematica itself expand these functions of general quaternions, without me having to redefine them all?