answered 3 years ago
I have used quaternions a few times perhaps here notebooks could provide some guidance.
http://alan.atstafford.co.uk/Penrose/Penrose.ipynb
http://alan.atstafford.co.uk/Twistor.ipynb