Skip to content

Commit c14af90

Browse files
committed
Fix for arc transforms -- use eigh instead of eig
We're computing eigenvectors/eigenvalues on real symmetric matrices so we should use the Hermitian form (np.linalg.eigh), which is guaranteed to return real eigenvectors/eigenvalues.
1 parent bb54e6b commit c14af90

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

svgpathtools/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def to_complex(v):
327327
invT = np.linalg.inv(tf[:2,:2])
328328
D = reduce(np.matmul, [invT.T, Q, invT])
329329

330-
eigvals, eigvecs = np.linalg.eig(D)
330+
eigvals, eigvecs = np.linalg.eigh(D)
331331

332332
rx = 1 / np.sqrt(eigvals[0])
333333
ry = 1 / np.sqrt(eigvals[1])

0 commit comments

Comments
 (0)