Contains the LinearEquation class, which encodes linear equations of any number of variables.
Author: Novak / cszach@proton.me
- LinearEquation
- ~LinearEquation
- new LinearEquation(coefficients, constant)
- .coefficients :
Array.<number>
- .constant :
number
- .numberOfVariables :
number
- .clone() ⇒
LinearEquation
- .multiplyScalar(k) ⇒
LinearEquation
- .negate() ⇒
LinearEquation
- .add(equation) ⇒
LinearEquation
- .subtract(equation) ⇒
LinearEquation
- .toArray() ⇒
Array.<number>
- ~LinearEquation
Encodes linear equations by storing coefficients in an array and the constant term. Coefficients are stored left-to-right.
Kind: inner class of LinearEquation
- ~LinearEquation
- new LinearEquation(coefficients, constant)
- .coefficients :
Array.<number>
- .constant :
number
- .numberOfVariables :
number
- .clone() ⇒
LinearEquation
- .multiplyScalar(k) ⇒
LinearEquation
- .negate() ⇒
LinearEquation
- .add(equation) ⇒
LinearEquation
- .subtract(equation) ⇒
LinearEquation
- .toArray() ⇒
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 of this equation's coefficients.
Kind: instance property of LinearEquation
The constant term of this linear equation.
Kind: instance property of LinearEquation
The number of variables in this linear equation.
Kind: instance property of 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
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. |
Negates this equation.
Kind: instance method of LinearEquation
Returns: LinearEquation
- This linear equation
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. |
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. |
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