dimforge / alga

Abstract algebra for Rust.
194 stars 39 forks source link

InnerSpace Angle Implementation Bug #97

Open shuyangsun opened 4 years ago

shuyangsun commented 4 years ago

The implementation of angle function on trait InnerSpace is incorrect. When calculating cang, instead of multiplying the inner product by the norms of two vectors, it should be dividing them.

The correct calculation should be let cang = prod.real().unscale(n1 * n2);.