complex solutions

This commit is contained in:
hugogogo
2026-05-11 22:36:55 +02:00
parent 6d2e7922bc
commit 37d9fa2f24
6 changed files with 65 additions and 170 deletions

View File

@@ -64,21 +64,14 @@ this project uses submodules (maybe recursively), so either :
-> Δ < 0 -> 2 solutions : x = ( -b / 2a ) +- i( √|Δ| / 2a )
-> solution :
- delta_sign; // + or -
- delta; // Δ
- delta_absolute; // |Δ|
- delta_sqrt; // √|Δ|
- first_term_gcd; // gcd(b, 2a)
- first_term_numerator; // -b / gcd
- first_term_denominator; // 2a / gcd
- first_term; // double (-b / 2a)
- second_term_gcd; // gcd(√|Δ|, 2a)
- second_term_numerator; // √|Δ| / gcd
- second_term_denominator; // 2a / gcd
- second_term; // double (√|Δ| / 2a)
- double solution1; // first_term + second_term
- double solution2; // first_term - second_term
- double solution1; // first_term + second_term || -b / 2a + √|Δ| * i / 2a
- double solution2; // first_term - second_term || -b / 2a - √|Δ| * i / 2a
6. print solution
---