C++ code to perform the Lorentz boosts and rotations of special relativity using complex quaternions The interface is a complex quaternion console-based calculator with operations + - * / ^ and functions for Lorentz boosts and rotations.
THEORY
Complex quaternions have form q = A + B * I + C * J + D * K with A, B, C, D complex
I * I = -1 , J * J = -1 , K * K = -1, I * J = K, J * I = -K , J * K = I,K * J = -I, K * I = J, I * K = -J
Transpose T takes I into -I, J into -J, K into -K
(q1 q2)T = q2T q1T
Star complex conjugates A, B, C, D
Bar is product of T and Star,
Norm(q) = qTq
Norm(q1*q2)=Norm(q1)*Norm( q2)
q in H1 iff q qT = qT q = 1
4-vector X=t + i*x*I +i*y*J + i*z*K
XPRIME = q X Bar(q) for q in H1
Form with real scalar, imaginary spatial is preserved
Bar(X) = X and Bar(XPRIME )= XPRIME
Norm(XPRIME) = Norm(X) = t*t - x*x - y*y - z*z
q=cos(theta/2)+K*sin(theta/2) rotates by theta about z
q=cosh(alpha/2)+i*I*sinh(alpha/2) boosts by alpha along x