Closed ghost closed 4 years ago
It probably means that the epsilon threshold used in is_normalized
is a bit too strict for the actual precision of normalize
.
Are you using it with f32
values?
I guess the right thing to do would be to brute-force random parameters of around_axis for a while and pick the smallest epsilon that doesn't break.
So I wrote quick and dirty program that tested epsilon values continuously, let it run for a while and for f32 rotations the best is_normalized threshold it could find was 0.00000040000000001150227
which is quite a bit smaller than the currently used 1.0e-5
, so the current threshold should be pretty safe.
Could you print the value of rotations that cause this issue? It could be containing NaN
s.
I will try that tomorrow. If the threshold isn't the problem, it is likely that my rotation contains NaNs.
Actually, I just took a quick look and it turns out I'm really stupid. I named a method the wrong thing to work properly with another crate and this all culminated in 2 vectors that I was taking the cross product of being the same. Closing.
I am having trouble normalizing a Rotation3D. here is my code:
when I run this, it panics complaining that the assertion
is_normalized()
fails for rotation. I tried calling is_normalized() on rotation myself and it returned false. I have no idea what is going wrong please help.