Skip to content

Refactor algebraic circle fit routine#11

Open
samantha-ho wants to merge 1 commit intosebastianprobst:masterfrom
samantha-ho:samanthaho/circlefit-refactor
Open

Refactor algebraic circle fit routine#11
samantha-ho wants to merge 1 commit intosebastianprobst:masterfrom
samantha-ho:samanthaho/circlefit-refactor

Conversation

@samantha-ho
Copy link

This PR refactors the core algebraic circle fit routine for improved usability and readability.

The core algebraic circle fit has been pulled into a separate, stand-alone module for easier reuse outside this set of tools.

Additionally, the previously hardcoded equations for the coefficients of the characteristic polynomial of (M - xB) have been replaced by first converting to the related eigenvalue problem (MB_inverse - xI)B whose determinant is det(MB_inverse-xI)*det(B). This allows us to use the Faddeev-LeVerrier Algorithm to calculate the coefficients of the characteristic polynomial without needing to hardcode them, and improves the readability of the code.

Finally, the automatic code-formatting tool black was run on circlefit.py, causing numerous formatting changes.

@sebastianprobst
Copy link
Owner

Thank you for your contribution. I have 2 questions:

  1. Can you confirm that the changed code produces identical results?
  2. Does the code run slower now? By how much?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants