use-equation 0.0.6

Small equation-solving primitives for RustUse
Documentation
  • Coverage
  • 100%
    61 out of 61 items documented1 out of 24 items with examples
  • Size
  • Source code size: 17.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 761.93 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-math
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-equation

Install

[dependencies]
use-equation = "0.0.6"

Optional low-degree polynomial bridging:

[dependencies]
use-equation = { version = "0.0.6", features = ["polynomial"] }

What belongs here

use-equation owns small, explicit equation-solving primitives over f64. It provides direct helpers for:

  • linear equations of the form ax + b = 0
  • quadratic equations of the form ax^2 + bx + c = 0
  • small 2x2 linear systems
  • reusable solving traits and equation wrapper structs

The crate stays intentionally small. It does not add symbolic algebra, arbitrary-precision arithmetic, iterative numerical methods, complex roots, or large linear system solvers in v1.

Neighboring crates

Crate Responsibility
use-equation Direct equation-solving helpers, result enums, and solving traits
use-polynomial Polynomial representation and direct polynomial operations
use-linear Higher-level linear algebra workflows and typed matrix-driven solves
use-matrix Matrix primitives
use-vector Vector primitives
use-calculus Calculus workflows and derivative or integral helpers
use-optimization Optimization routines that may consume equation models
use-complex Complex numbers and complex roots
use-numerical Iterative numerical root-finding methods

Examples

Solve a linear equation

use use_equation::{Roots, solve_linear};

assert_eq!(solve_linear(2.0, -4.0), Roots::One(2.0));

Solve a quadratic equation

use use_equation::{Roots, solve_quadratic};

assert_eq!(solve_quadratic(1.0, -3.0, 2.0), Roots::Two(1.0, 2.0));

Solve a 2x2 system

use use_equation::solve_2x2;

let solution = solve_2x2(
    2.0, 1.0, 5.0,
    1.0, -1.0, 1.0,
);

assert_eq!(solution, Some((2.0, 1.0)));

Use the RootSolver trait

use use_equation::{LinearEquation, RootSolver, Roots};

let equation = LinearEquation::new(2.0, -4.0);

assert_eq!(equation.solve(), Roots::One(2.0));

Status

use-equation is a concrete pre-1.0 crate in the RustUse math workspace. It keeps equation solving explicit and reusable so neighboring polynomial, numerical, linear algebra, simulation, optimization, and physics crates can build on a small shared surface.