packages/solver/lib/solveEquation/stepThrough.js
function step(equation, symbolName) {
  const solveFunctions = [
    // ensure the symbol is always on the left node
    EquationOperations.ensureSymbolInLeftNode,
    // get rid of denominators that have the symbol
    EquationOperations.removeSymbolFromDenominator,
    // remove the symbol from the right side
    EquationOperations.removeSymbolFromRightSide,
    // isolate the symbol on the left side
    EquationOperations.isolateSymbolOnLeftSide,
  ];

  for (let i = 0; i < solveFunctions.length; i++) {
    const equationStatus = solveFunctions[i](equation, symbolName);

    if (equationStatus.hasChanged()) {
      return equationStatus;
    }
  }
  return EquationStatus.noChange(equation);
}
function step(equation, symbolName) {
  const solveFunctions = [
    // ensure the symbol is always on the left node
    EquationOperations.ensureSymbolInLeftNode,
    // get rid of denominators that have the symbol
    EquationOperations.removeSymbolFromDenominator,
    // remove the symbol from the right side
    EquationOperations.removeSymbolFromRightSide,
    // isolate the symbol on the left side
    EquationOperations.isolateSymbolOnLeftSide,
  ];

  for (let i = 0; i < solveFunctions.length; i++) {
    const equationStatus = solveFunctions[i](equation, symbolName);

    if (equationStatus.hasChanged()) {
      return equationStatus;
    }
  }
  return EquationStatus.noChange(equation);
}
function step ( equation , symbolName ) { const solveFunctions = [ // ensure the symbol is always on the left node EquationOperations . ensureSymbolInLeftNode , // get rid of denominators that have the symbol EquationOperations . removeSymbolFromDenominator , // remove the symbol from the right side EquationOperations . removeSymbolFromRightSide , // isolate the symbol on the left side EquationOperations . isolateSymbolOnLeftSide , ] ; for ( let i = 0 ; i < solveFunctions . length ; i ++ ) { const equationStatus = solveFunctions [ i ] ( equation , symbolName ) ; if ( equationStatus . hasChanged ( ) ) { return equationStatus ; } } return EquationStatus . noChange ( equation ) ; }
Given a symbol and an equation, performs a single step to solve for the symbol. Returns an Status object.
Given a symbol and an equation performs a single step to solve for the symbol . Returns an Status object .