LinearEquation
Represents a linear equation of the form x + r = 0 where r is a rational number. The slope of the line representing the equation is one, therefore the intercepts are: x = -r when y = 0 (the solution/root); and y = r when x = 0. This class provides various operations and transformations specific to linear equations.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Equationtrait Renderabletrait Branched[Expression]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Scales the current instance by the given factor.
Scales the current instance by the given factor.
This method applies a scaling operation on the instance using the provided rational factor and returns the resulting scaled instance.
Value parameters
- factor
-
the rational number representing the scale factor
Attributes
- Returns
-
the scaled instance of type
T
Retrieves the branch at the specified index.
Retrieves the branch at the specified index.
Value parameters
- index
-
the index of the branch to retrieve, where the index starts from 0.
Attributes
- Returns
-
the element of type
Tat the specified branch index. If the index is out of range, the behavior is implementation-specific.
Method to compute the number of branches related to a specific computation or process. For example, a solution to a quadratic equation has two branches, one for the real part and one for the imaginary part.
Method to compute the number of branches related to a specific computation or process. For example, a solution to a quadratic equation has two branches, one for the real part and one for the imaginary part.
Attributes
- Returns
-
the number of branches as an integer.
Evaluates the provided Solution within the context of this LinearEquation.
Evaluates the provided Solution within the context of this LinearEquation.
If the Solution is an instance of LinearSolution with a numerical value, the method evaluates it by adding a predefined offset r. If the Solution does not match the expected type or structure, an AlgebraException is thrown.
Value parameters
- s
-
the
Solutionto be evaluated. It is expected to be an instance ofLinearSolutioncontaining a numerical value.
Attributes
- Returns
-
the result of the evaluation as an instance of
Eager. The exact nature of the result depends on the structure of the providedSolution. - Note
-
Throws AlgebraException if the
Solutioncannot be evaluated within the constraints of thisLinearEquation.
Produces an inverted version of the current equation. The inversion process involves switching or rearranging key components of the equation, depending on its mathematical structure.
Produces an inverted version of the current equation. The inversion process involves switching or rearranging key components of the equation, depending on its mathematical structure.
Attributes
- Returns
-
a new
Equationinstance representing the inverted form of the current equation.
Shifts the origin of the given equation by the specified rational value. This method adjusts the equation's reference point, effectively translating it to a new position in its domain.
Shifts the origin of the given equation by the specified rational value. This method adjusts the equation's reference point, effectively translating it to a new position in its domain.
Given this equation P(x) = 0, such that z is a solution, this method returns the equation P(y) = 0 such that z + c is a solution.
CONSIDER a better name for this.
Value parameters
- c
-
the rational value by which to shift the origin of the equation.
Attributes
- Returns
-
a new
Equationinstance with its origin shifted by the specified value.
Attempts to find a solution for a mathematical equation corresponding to the given branch. Solutions are represented as an instance of the Algebraic or of Complex class.
Attempts to find a solution for a mathematical equation corresponding to the given branch. Solutions are represented as an instance of the Algebraic or of Complex class.
Value parameters
- branch
-
the branch index for which the solution is being sought. The branch index identifies specific solutions for equations that may have multiple solutions.
Attributes
- Returns
-
a
Field, which is either anAlgebraic(real-valued) or aComplex.
Transforms the current equation by applying the provided functions to its components.
Transforms the current equation by applying the provided functions to its components.
Value parameters
- fP
-
a function that takes two
Rationalparameters and produces aRationalresult. It is applied to the first component of the equation. - fQ
-
a function that takes two
Rationalparameters and produces aRationalresult. It is applied to the second component of the equation.
Attributes
- Returns
-
a new
Equationinstance that is the result of applying the specified transformations to the components of the current equation.
Inherited methods
Multiplies the current instance by the specified integer factor.
Multiplies the current instance by the specified integer factor.
Value parameters
- factor
-
the integer value to multiply with the current instance
Attributes
- Returns
-
a new instance of type
Trepresenting the result of the multiplication - Inherited from:
- Scalable
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Concrete fields
Method to render this Valuable for presentation to the user.
Method to render this Valuable for presentation to the user.
Attributes
- Returns
-
a String