Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser

Quick Information

Equation solver for finding real roots of equations up to 4th degree for Godot.Methodsfloat cbrt(x: float) staticfloat solve_linear(a: float, b: float) staticArray[float] solve_quadratic(a: float, b: float, c: float) staticArray[float] solve_cubic(a: float, b: float, c: float, d: float) staticArray[float] solve_quartic(a: float, b: float, c: float, d: float, e: float) staticArray[float] generate_linear(r1: float) staticArray[float] generate_quadratic(r1: float, r2: float) staticArray[float] generate_cubic(r1: float, r2: float, r3: float) staticArray[float] generate_quartic(r1: float, r2: float, r3: float, r4: float) staticExamplefunc example() -> void:print(RES.cbrt(27)) # Prints 3print(RES.solve_linear(5, -10)) # Prints 2print(RES.solve_quadratic(1, 1, -6)) # Prints [-3, 2]print(RES.solve_cubic(2, -11, 12, 9)) # Prints [-0.5, 3]print(RES.solve_quartic(1, -10, 35, -50, 24)) # Prints [1, 2, 3, 4]print(RES.generate_quartic(1, 2, 3, 4)) # Prints [1, -10, 35, -50, 24]
Equation solver for finding real roots of equations up to 4th degree for Godot.
Methods
float cbrt(x: float) static
float solve_linear(a: float, b: float) static
Array[float] solve_quadratic(a: float, b: float, c: float) static
Array[float] solve_cubic(a: float, b: float, c: float, d: float) static
Array[float] solve_quartic(a: float, b: float, c: float, d: float, e: float) static
Array[float] generate_linear(r1: float) static
Array[float] generate_quadratic(r1: float, r2: float) static
Array[float] generate_cubic(r1: float, r2: float, r3: float) static
Array[float] generate_quartic(r1: float, r2: float, r3: float, r4: float) static
Example
func example() -> void:
print(RES.cbrt(27)) # Prints 3
print(RES.solve_linear(5, -10)) # Prints 2
print(RES.solve_quadratic(1, 1, -6)) # Prints [-3, 2]
print(RES.solve_cubic(2, -11, 12, 9)) # Prints [-0.5, 3]
print(RES.solve_quartic(1, -10, 35, -50, 24)) # Prints [1, 2, 3, 4]
print(RES.generate_quartic(1, 2, 3, 4)) # Prints [1, -10, 35, -50, 24]
Reviews
Quick Information

Equation solver for finding real roots of equations up to 4th degree for Godot.Methodsfloat cbrt(x: float) staticfloat solve_linear(a: float, b: float) staticArray[float] solve_quadratic(a: float, b: float, c: float) staticArray[float] solve_cubic(a: float, b: float, c: float, d: float) staticArray[float] solve_quartic(a: float, b: float, c: float, d: float, e: float) staticArray[float] generate_linear(r1: float) staticArray[float] generate_quadratic(r1: float, r2: float) staticArray[float] generate_cubic(r1: float, r2: float, r3: float) staticArray[float] generate_quartic(r1: float, r2: float, r3: float, r4: float) staticExamplefunc example() -> void:print(RES.cbrt(27)) # Prints 3print(RES.solve_linear(5, -10)) # Prints 2print(RES.solve_quadratic(1, 1, -6)) # Prints [-3, 2]print(RES.solve_cubic(2, -11, 12, 9)) # Prints [-0.5, 3]print(RES.solve_quartic(1, -10, 35, -50, 24)) # Prints [1, 2, 3, 4]print(RES.generate_quartic(1, 2, 3, 4)) # Prints [1, -10, 35, -50, 24]