Wednesday, August 8, 2018

Repeated Quaternion Multiplications in Excel


  We can do repeated quaternion multiplications in Excel by a method similar to that used for complex multiplications with the user function qMult(p,a,b). To find the constant multiplier needed below we find q=a/b=a(-b/|b|)=-ab then do the row of multiplications.



The VBA code for qMult(p,a,b) is as follows. Note the change in the order of the variables with the pointer p given first.


Using this drag and fill method gets around some of the limitations of user functions in Excel.

edit (Aug 8): Did some cleanup on the first image. p and q are now in the first row and with 1, i, j, k showing for the second row of multiplications. Corrected mislabeled axes in the plot.

No comments: