The current implementation handles the near zeros value really well by computing with the largest denominator. However, this will leave the w to be not always positive. Though it will not affect general operation like multiplication, it can result in unexpected behaviors in quaternion blendings.
Moreover, this only happens when the trace is near zero making it more mysterious and unpredictable. I am currently implenting a dual quaternion blending function with it, and it really takes me several good days to find out the reason.
So I suggest add a line of standardize at the end.
The current implementation handles the near zeros value really well by computing with the largest denominator. However, this will leave the
w
to be not always positive. Though it will not affect general operation like multiplication, it can result in unexpected behaviors in quaternion blendings.Moreover, this only happens when the trace is near zero making it more mysterious and unpredictable. I am currently implenting a dual quaternion blending function with it, and it really takes me several good days to find out the reason.
So I suggest add a line of standardize at the end.