Skip to content

An engine that can parse and calculate math equations, with support for custom operators, functions, and variables

Notifications You must be signed in to change notification settings

ShimmyMySherbet/MathEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathEngine

An engine that can parse and calculate math equations, with support for custom operators, functions, and variables

Examples

var engine = new MathEngine();
var result = engine.Calculate("Sqrt(7^2+10^2)");
var result = engine.Calculate("(sin(46)*20)/2")
var equation = engine.Build("sqrt(10^2+27.7^2)");
Console.WriteLine(equation);
Console.WriteLine(equation.Calculate());

// Sqrt(Plus(Exponent(10, 2), Exponent(27.7, 2)))
// 29.449787775126666

Features

  • Follows Order of Operations
  • More than 30 prefefined functions
  • Syntax Detection/Checking
  • Support for equation variables
  • Support for custom functions
  • Support for custom operators
  • Order of operations settings for custom operators
  • View the structure of a built equation

About

An engine that can parse and calculate math equations, with support for custom operators, functions, and variables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages