Quaternion angle with itself > 0.001

Started by
19 comments, last by alvaro 9 years, 8 months ago
You can also compute the angle between quaternions using
  dot_product = dot4(qa, qb);
  dot_product_squared = dot_product * dot_product;
  denominator = dot4(qa, qa) * dot4(qb, qb);
  return 2.0f * acos(sqrt(abs(dot_product_squared / denominator)));
I haven't tried it, so there could be mistakes. The idea is to not rely on the inputs being normalized, and write the expression in such a way that you are guaranteed to get exactly 0 if you qa==qb.

This topic is closed to new replies.

Advertisement