Menu

Equation

Nicolas Hainaux

These objects are one variable first degree equations of all sorts, plus the case of x² = a (which includes the calculus of a right triangle's side's length using pythagorean theorem). Later they might also be equations of higher degree.

The main methods are solve_next_step(), which determines what is the next step in the solving of the Equation, and auto_resolution() which uses solve_next_step() to produce the entire resolution of the Equation.

Possible arg for __init__():

  • Equation
  • SubstitutableEquality (its length must be 2 and there must be only one variable)
  • (Exponented, Exponented)
    These Exponenteds will be the left and right members of the Equation
  • (RANDOMLY, <type>)

where <type> can be:
- 'basic_addition': will create x + a = b | a + x = b
- 'basic_addition_r': will create b = x + a | b = a + x
- 'any_basic_addition': will create any of the basic_addition* ones
- 'basic_multiplication': will create ax = b
- 'basic_multiplication_r': will create b = ax
- 'any_basic_multiplication': will create any of the basic_multiplication* ones
- 'any_basic': will create any of the basic*
- 'classic': will create ax + b = c | b + ax = c
- 'classic_r': will create c = ax + b | c = b + ax
- 'classic_x_twice': will create ax + b = cx + d | ax + b = cx | cx = ax + b | b + ax = cx + d etc.
- 'any_classic': will create any of the preceding classic*
- 'classic_with_fractions': will create ax + b = c | b + ax = c where a, b, and c are Fractions
- 'any_simple_expandable': will create an Equation having on one side, in any order, terms of these kinds: a(bx + c) | ±(ax + b) and ax; and on the other side: ax + b | ax | b
- 'any_double_expandable': same as 'any_simple_expandable', plus a second a(bx + c) term on one side randomly chosen

Options:

  • name=<string>
  • number=<nb>
  • variable_letter_name=<string>

Fields:
variable_letter: it's 'x', per default, but you can set another letter here
number: this is the number that will show up when displaying numbered equations' names, like (E1), (E2) etc.
left_hand_side: that's the left hand side of the Equation (as an Exponented)
right_hand_side: that's the right hand side of the Equation (also as an Exponented)

Debugging info: no dbg_str() method so far

Check Equation's complete doc

Back


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.