Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

RES - Real Equation Solver

An asset by neclor
The page banner background of a mountain and forest
RES - Real Equation Solver hero image

Quick Information

0 ratings
RES - Real Equation Solver icon image
neclor
RES - Real Equation Solver

Equation solver and generator for real-valued polynomial equations up to degree 4 in Godot.Methods:Res# Cbrtfloat cbrt(x: float) static# Solvefloat 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) static# GenerateArray[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) staticExample:func 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]

Supported Engine Version
4.0
Version String
3.1.2
License Version
MIT
Support Level
community
Modified Date
4 days ago
Git URL
Issue URL

RES - Real Equation Solver

Equation solver and generator for real-valued polynomial equations up to degree 4 in Godot.

Methods

Res


# Cbrt

float cbrt(x: float) static


# Solve

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


# Generate

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]

Equation solver and generator for real-valued polynomial equations up to degree 4 in Godot.

Methods:
Res

# Cbrt
float cbrt(x: float) static

# Solve
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

# Generate
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

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
RES - Real Equation Solver icon image
neclor
RES - Real Equation Solver

Equation solver and generator for real-valued polynomial equations up to degree 4 in Godot.Methods:Res# Cbrtfloat cbrt(x: float) static# Solvefloat 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) static# GenerateArray[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) staticExample:func 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]

Supported Engine Version
4.0
Version String
3.1.2
License Version
MIT
Support Level
community
Modified Date
4 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers