Contains the LinearEquation class, which encodes linear equations of any number of variables.
Author: Zach / cszach@proton.me
Array.<number>
number
number
LinearEquation
LinearEquation
LinearEquation
LinearEquation
LinearEquation
Array.<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>
number
number
LinearEquation
LinearEquation
LinearEquation
LinearEquation
LinearEquation
Array.<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
number
The constant term of this linear equation.
Kind: instance property of LinearEquation
number
The number of variables in this linear equation.
Kind: instance property of LinearEquation
LinearEquation
Returns 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
LinearEquation
Multiplies 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. |
LinearEquation
Negates this equation.
Kind: instance method of LinearEquation
Returns: LinearEquation
- This linear equation
LinearEquation
Adds 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. |
LinearEquation
Subtracts 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