Bug in calculate.py : rotation matrix
Description Rotation matrix are set to zero during calculations in the acoustic forward model although they should not.
Specify a priority (low, medium, high) Medium
Current Behavior
In \simpa\simpa\utils\calculate.py l.233-234 :
if np.abs(cross_product.all()) < 1e-10:
return np.zeros([3, 3])
The rotation matrix is set to 0 if cross_product.all() == 0 == False, but cross_product.all() only send True if all the components from the vector are non null. However, two vectors can have a cross product that has a null component on an axis and have a non-null rotation matrix at the same time. So I have errors appearing everywhere. It's by the way surprising because I didn't have them before. For example, when I'm running the automatic tests with generate_overview.py, I now have some tests failing because of that, although they were all passing before.
Expected behavior
I just commented these two lines for the moment, as the correct rotation_matrix is still returned. I guess this was set to avoid calculating rotation matrix with too small coefficients, so iterating over all the coefficients of the cross product and sending 0 if all of them or the norm are under a small treshold could be an alternative.
Environment:
- OS: Windows 11
- SIMPA version: 1.0.0
- IDE: VS Code