Expand description
Basic math formulas for quadratic equations and 2x2 matrices.
This crate currently supports:
- quadratic equation solving (
ax^2 + bx + c = 0) - 2x2 matrix determinant
- other common 2x2 matrix operations: trace, transpose, inverse
- solving a 2x2 linear system using Cramer’s rule
Enums§
- Math
Error - Errors returned by math operations in this crate.
- Quadratic
Roots - The root structure returned by
solve_quadratic.
Functions§
- determinant_
2x2 - Computes the determinant of a 2x2 matrix.
- discriminant
- Computes the discriminant of a quadratic equation:
b^2 - 4ac. - inverse_
2x2 - Computes the inverse of a 2x2 matrix.
- solve_
linear_ 2x2 - Solves a 2x2 linear system
A * x = busing Cramer’s rule. - solve_
quadratic - Solves the quadratic equation
ax^2 + bx + c = 0. - trace_
2x2 - Computes the trace of a 2x2 matrix (
a + d). - transpose_
2x2 - Computes the transpose of a 2x2 matrix.
Type Aliases§
- Matrix2x2
- A 2x2 matrix represented as:
[[a, b], [c, d]]