QuadraticSolution

com.phasmidsoftware.number.algebra.eager.QuadraticSolution
See theQuadraticSolution companion class

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 Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(base: Structure, offset: Structure, coefficient: Int, imaginary: Boolean): QuadraticSolution

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 QuadraticSolution instance 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/2 into a Value using Value.fromRational.
  • The second coefficient provided by converting 5/4 into a Value using Value.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

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)

Attributes