Contains the LinearEquation class, which encodes linear equations of any number of variables.
Author: Zach / cszach@proton.me
Array.<number>numbernumberLinearEquationLinearEquationLinearEquationLinearEquationLinearEquationArray.<number>Encodes linear equations by storing coefficients in an array and the constant term. Coefficients are stored left-to-right.
Kind: inner class of LinearEquation
Array.<number>numbernumberLinearEquationLinearEquationLinearEquationLinearEquationLinearEquationArray.<number>Constructs a LinearEquation instance, which encodes a linear equation.
| Param | Type | Description |
|---|---|---|
| coefficients | Array.<number> |
The coefficients of the linear equation. |
| constant | number |
The constant term of the linear equation. |
Array.<number>Array of this equation’s coefficients.
Kind: instance property of LinearEquation
numberThe constant term of this linear equation.
Kind: instance property of LinearEquation
numberThe number of variables in this linear equation.
Kind: instance property of LinearEquation
LinearEquationReturns an instance of LinearEquation that is exactly the same as this
instance.
Kind: instance method of LinearEquation
Returns: LinearEquation - An exact copy of this instance
LinearEquationMultiplies this linear equation with a scalar.
Kind: instance method of LinearEquation
Returns: LinearEquation - This linear equation
| Param | Type | Description |
|---|---|---|
| k | number |
The scalar to multiply this equation by. |
LinearEquationNegates this equation.
Kind: instance method of LinearEquation
Returns: LinearEquation - This linear equation
LinearEquationAdds a linear equation to this linear equation.
Kind: instance method of LinearEquation
Returns: LinearEquation - This linear equation
| Param | Type | Description |
|---|---|---|
| equation | LinearEquation |
The equation to add to this equation. Both equations must have the same number of coefficients. |
LinearEquationSubtracts a linear equation from this linear equation.
Kind: instance method of LinearEquation
Returns: LinearEquation - This linear equation
| Param | Type | Description |
|---|---|---|
| equation | LinearEquation |
The equation to subtract this equation to. Both equations must have the same number of coefficients. |
Array.<number>Returns an array containing the coefficients from left to right and the constant. Helpful in converting to a row or column vector.
Kind: instance method of LinearEquation
Returns: Array.<number> - The array representation of this linear equation