refactoring and other stuff

This commit is contained in:
2022-08-31 13:03:17 +02:00
parent e651fddd56
commit d29a961763
3 changed files with 135 additions and 119 deletions

View File

@@ -347,8 +347,13 @@ class geometry:
A[:,0:2]=points[:,:2]
y=np.asmatrix(y.ravel()).T
A=np.asmatrix(A)
aa=(A.T*A).I*A.T*y
try:
aa=(A.T*A).I*A.T*y
except np.linalg.LinAlgError as e:
_log.warning(e)
return
aa=aa.A.ravel()
print(f'plane={aa[0]}X+{aa[1]}Y+{aa[2]}')
for p in points:
print(f'{p}->{aa[0]*p[0]+aa[1]*p[1]+aa[2]}')
self._fitPlane=aa