Skip to content

API Overview

Marcus Ackre Medina edited this page Sep 13, 2026 · 1 revision

API Overview

Algebra — entry points

Namespace: MarcusMedina.Maths.Algebra.Builders

Member Type Description
Algebra.X VariableExpression Variable named "x"
Algebra.Y VariableExpression Variable named "y"
Algebra.Z VariableExpression Variable named "z"
Algebra.Var(name) VariableExpression Custom variable
Algebra.Variable(name) VariableExpression Custom variable (long form of Var)
Algebra.Constant(value) ConstantExpression Explicit constant

Algebra also exposes static builder equivalents of every fluent method below — e.g. Algebra.Add(left, right), Algebra.Multiply(left, right), Algebra.Sqrt(expr), Algebra.Sin(expr), Algebra.Cos(expr), Algebra.Ln(expr), Algebra.Abs(expr), Algebra.Negate(expr) — for when you'd rather compose expressions functionally than chain them.

IAlgebraExpression — fluent operations

Namespace: MarcusMedina.Maths.Algebra.Extensions

Arithmetic

Method Description
.Add(expr / double) Addition
.Subtract(expr / double) Subtraction
.Multiply(expr / double) Multiplication
.Divide(expr / double) Division
.Power(expr / double) Exponentiation
.Negate() Unary minus

Shortcuts

Method Equivalent
.Square() .Power(2)

Math functions

Also in MarcusMedina.Maths.Algebra.Extensions (MathExtensions):

Method Description
.Sqrt() sqrt(expr)
.AbsoluteValue() abs(expr)
.Sin() / .Cos() / .Tan() Trigonometric functions (radians)
.ArcSin() / .ArcCos() / .ArcTan() Inverse trigonometric functions (result in radians)
.Log() Natural logarithm (ln)
.Log10() Base-10 logarithm
.Exp() e raised to the expression
.Floor() / .Ceiling() Round down / up

Evaluation & transformation

Method Returns Description
.Evaluate(vars?) double Numeric evaluation
.Evaluate(name, value) double Single-variable shorthand
.EvaluateRange(name, start, end, steps) IEnumerable<double> Evaluate at steps evenly spaced points from start to end
.Substitute(name, value) IAlgebraExpression Replace variable with constant
.Substitute(name, expr) IAlgebraExpression Replace variable with another expression
.Simplify() IAlgebraExpression Constant folding
.ToString() string Human-readable form
.ToLaTeX() string LaTeX notation

.Evaluate(name, value) and .EvaluateRange(...) live in MarcusMedina.Maths.Algebra.Evaluators (AlgebraEvaluator) — import that namespace alongside Extensions to use them.

There is currently no symbolic differentiation (Differentiate) in this package, despite what older docs may have suggested — expressions can be built, evaluated, substituted, simplified and formatted, but not differentiated.

AlgebraParser

Namespace: MarcusMedina.Maths.Algebra.Parsers

IAlgebraExpression AlgebraParser.Parse(string expression)

Supports: + - * / ^, parentheses, variables, and functions: sin, cos, tan, asin, acos, atan, sqrt, exp, ln, log, log10, floor, ceiling, abs

Clone this wiki locally