Object containing predefined solutions to a quadratic equation and utilities.
The object includes two specific solutions (phi and psi) that are parametrized using the QuadraticSolution class, demonstrating the representation of roots of a quadratic equation. These roots are computed using predefined rational coefficients and specified root indices.
Attributes
- Companion
- class
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
QuadraticSolution.type
Members list
Value members
Concrete methods
Creates a new instance of QuadraticSolution using the provided base monotone, offset monotone, and coefficient index.
Creates a new instance of QuadraticSolution using the provided base monotone, offset monotone, and coefficient index.
Value parameters
- base
-
the base component of the quadratic solution, represented as a
Structure - coefficient
-
an integer specifying the coefficient of the solution
- offset
-
the offset component of the quadratic solution, represented as a
Structure
Attributes
- Returns
-
a new
QuadraticSolutioninstance constructed from the provided parameters
Calculates the square root of a given rational number as a monotone function.
Calculates the square root of a given rational number as a monotone function.
Value parameters
- r
-
the rational number for which the square root is to be computed.
Attributes
- Returns
-
a monotone representation of the square root of the given rational number.
Concrete fields
Represents the value phi, which is a solution of a quadratic equation derived using QuadraticSolution. The solution is constructed from:
Represents the value phi, which is a solution of a quadratic equation derived using QuadraticSolution. The solution is constructed from:
- The first coefficient provided by converting
1/2into aValueusingValue.fromRational. - The second coefficient provided by converting
5/4into aValueusingValue.fromRational. - The root type specified as
SquareRoot. - The root index specified as
0, which identifies this as one of the possible roots.
Attributes
Represents a specific quadratic solution characterized by its parameters.
Represents a specific quadratic solution characterized by its parameters.
Attributes
- See also
-
QuadraticSolution
Value.fromRational
Givens
Implicits
Implicits
LatexRenderer for QuadraticSolution.
LatexRenderer for QuadraticSolution.
Renders as:
- Named constants (φ, ψ) use their LaTeX symbols
- Real roots: base ± offset
- Complex roots: base ± i·offset
- Normalizes when appropriate (zero offset or zero base)