View Source Chi2fit.Roots (Chi-SquaredFit v2.0.2)

Solves roots for linear, quadratic, and cubic equations.

Link to this section Summary

Functions

Returns the real roots of polynoms of order 1, 2 and 3 as a list.

Link to this section Functions

@spec solve([float()]) :: [float()]

Returns the real roots of polynoms of order 1, 2 and 3 as a list.

examples

Examples

Solve `2.0*x + 5.0 = 0`
iex> solve [2.0,5.0]
[-2.5]

iex> solve [2.0,-14.0,24.0]
[4.0,3.0]

iex> solve [1.0,0.0,5.0,6.0]
[-0.9999999999999999]