So no need to see all the code but basically I have an initial point:
import numpy as np
point = np.array([3.0000, 8.0000, 0.0000])
I also have a transformation matrix M which works fine that needs to transform the point into the X-axis only, this yields the following:
[-5.09901951 0. 0. ] // which is perfectly what I need it to be
Usually in my code I need to perform alterations in the local coordinate then cast it back to global. For that I use the inverse matrix to take it back. However just for testing I will bring back the point unchanged.
//Using numpy:
MInv =np.linalg.inv(M)
now when I use the same function to transform my output to the original state I get:
[ 3.01941932 7.90290338 0. ] // result should be [3.0000, 8.0000, 0.0000]
Clearly there is a numerical precision problem with using linalg.inv()
in numpy
. Can someone help me bypass the error ?