Edit of asset "RES - Real Equation Solver" Accepted
Old/Current | New/Edit | |
---|---|---|
Title | RES - Real Equation Solver | Equations Real Solver |
Description |
Equation solver and generator for real-valued polynomial equations up to 4th degree. Example: func example() -> void: print(Res.linear(5, -10)) # Prints 2 print(Res.quadratic(1, 1, -6)) # Prints [-3, 2] print(Res.cubic(2, -11, 12, 9)) # Prints [-0.5, 3] print(Res.quartic(1, -10, 35, -50, 24)) # Prints [1, 2, 3, 4] print(Reg.quartic(1, 2, 3, 4)) # Prints [1, -10, 35, -50, 24] |
Functions on GDScript for finding real roots of equations of 1-4 degrees. Usage Functions take a value of type float and return a sorted array of real roots. If there are no roots, return an empty array. Examples func example(): var roots: Array[float] = Equation.quartic_solve_real(1, -10, 35, -50, 24) print(roots) # Prints "[1, 2, 3, 4]" roots = Equation.cubic_solve_real(2, -11, 12, 9) print(roots) # Prints "[-0.5, 3]" Functions in current version linear_solve_real(a: float, b: float) -> Array[float] quadratic_solve_real(a: float, b: float, c: float) -> Array[float] cubic_solve_real(a: float, b: float, c: float, d: float) -> Array[float] quartic_solve_real(a: float, b: float, c: float, d: float, e: float) -> Array[float] Warning Arguments that are too large or small can lead to inaccurate answers. |
Category | Scripts | Scripts |
License | MIT | MIT |
Repository Provider | GitHub | GitHub |
Repository Url | https://github.com/neclor/godot-real-equation-solver | https://github.com/neclor/equations-real-solver-godot |
Issues Url | https://github.com/neclor/real-equation-solver-godot/issues | https://github.com/neclor/equations-real-solver-godot/issues |
Godot version | Godot 4.0 | Godot 4.0 |
Version String | 4.0.0 | 1.0.0 |
Download Commit | ae038000cc14e186678533214961d99e78bf4f9c | 8b2278cfd0ef90f3e78d782dadcf9052ad379c84 |
Download Url (Computed) | https://github.com/neclor/godot-real-equation-solver/archive/ae038000cc14e186678533214961d99e78bf4f9c.zip | https://github.com/neclor/equations-real-solver-godot/archive/8b2278cfd0ef90f3e78d782dadcf9052ad379c84.zip |
Icon Url |
https://raw.githubusercontent.com/neclor/real-equation-solver-godot/main/icon.png
![]() |
https://raw.githubusercontent.com/neclor/equations-real-solver-godot/main/docs/icon.png
![]() |