wip implemented new union for solve
This commit is contained in:
47
README.md
47
README.md
@@ -48,21 +48,34 @@ this project uses submodules (maybe recursively), so either :
|
||||
-> if degree 3 :
|
||||
- print degree
|
||||
5. solve
|
||||
-> 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_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
|
||||
-> degree 1 :
|
||||
-> ax + b = 0 <=> ax = -b <=> x = -b / a
|
||||
-> solution :
|
||||
- a; // double
|
||||
- b; // double
|
||||
- solution_gcd; // gcd(b, a)
|
||||
- solution_numerator; // -b / gcd
|
||||
- solution_denominator; // a / gcd
|
||||
- solution; // double (-b / a)
|
||||
-> degree 2 :
|
||||
-> discriminant : Δ = b² - 4ac
|
||||
-> Δ > 0 -> 2 solutions : x = ( -b / 2a ) +- ( √|Δ| / 2a )
|
||||
-> Δ == 0 -> 1 solution : x = ( -b / 2a )
|
||||
-> Δ < 0 -> 2 solutions : x = ( -b / 2a ) +- i( √|Δ| / 2a )
|
||||
-> solution :
|
||||
- a; // double
|
||||
- b; // double
|
||||
- c; // double
|
||||
- delta_sign; // + or -
|
||||
- delta_absolute; // |Δ|
|
||||
- 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
|
||||
6. print solution
|
||||
|
||||
Reference in New Issue
Block a user