init solver
This commit is contained in:
19
README.md
19
README.md
@@ -44,4 +44,21 @@ this project uses submodules (maybe recursively), so either :
|
||||
5. find degree
|
||||
6. print degree
|
||||
7. solve
|
||||
8. print solution
|
||||
-> discriminant : Δ = b² - 4ac
|
||||
-> Δ > 0 -> 2 solutions : x = ( -b / 2a ) +- ( √|Δ| / 2a )
|
||||
-> Δ == 0 -> : x = ( -b / 2a )
|
||||
-> Δ < 0 -> 2 solutions : x = ( -b / 2a ) +- i( √|Δ| / 2a )
|
||||
-> solution :
|
||||
- delta_sign; // + or -
|
||||
- delta_absolute; // |Δ|
|
||||
- first_term_pgcd; // pgcd(b, 2a)
|
||||
- first_term_numerator; // -b / pgcd
|
||||
- first_term_denominator; // 2a / pgcd
|
||||
- first_term; // double (-b / 2a)
|
||||
- second_term_pgcd; // pgcd(√|Δ|, 2a)
|
||||
- second_term_numerator; // √|Δ| / pgcd
|
||||
- second_term_denominator; // 2a / pgcd
|
||||
- second_term; // double (√|Δ| / 2a)
|
||||
- double solution1; // first_term + second_term
|
||||
- double solution2; // first_term - second_term
|
||||
8. print solution
|
||||
|
||||
Reference in New Issue
Block a user