Refactor some arithmetic expressions for simplicity and optimization purposes.
Use Boolean variable to store Boolean value.
Check if fitted curve is an ellipse.
Use zero initialization instead of calling memset function to initialize struct with ellipse box.