Hi!
MichaelM wrote:
Been following this thread.
It appears that the desire is to convert the elements of the 3D rotation matrix from products of trig functions to sums of trig functions. This appears to be motivated by a desire to reduce the number of multiplies. This is a laudable goal if not for the fact that the trig functions themselves will require many multiplications to evaluate to a desired level of accuracy.
I suspect that the processing time savings achieved by a reduction in the number of multiplies present in the 3D rotation matrix elements will be swamped by the number of additional trig functions that will be required to represent the elements as sums instead of products. Assuming that a trig function evaluation consists is 8x longer than a multiply, the evaluation of the element
cos(z)sin(y)sin(x) as [cos(a) + cos(b) - cos(c) - cos(d)] / 4
will result in 8 + 8 + 8 + 2 operations versus 8 + 8 + 8 + 8 operations (assuming divide by 4 is free). Thus, evaluation of the product form will require approximately 26 operations and the evaluation of the sum form will require approximately 32 operations. This makes the product form more efficient than the sum form.
I am not seeing a path where the number of trig function evaluations is reduced by converting from the product form to the sum form. It is an interesting exercise in using trig identities, but I am not seeing the benefit to the exercise.
Am I missing something?
Yes.
You can evaluate the trigonometric functions with the required precision (8 bits) with a simple table lookup, so it is faster than a standard multiplication.
Have Fun!