Basic math utils
- Extend functions for float and double. e.g. Round, AlmostEqual, Limit.
- Compute characteristic of array or 2d-array, e.g. Bound, Scale.
- Methods for polar coordinates, e.g. Rotate, Distance, Near.
- Parse algebraic expression and calculate, e.g. parse "3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3" and return 3.5.
Package | Content |
---|---|
Aryth |
The core library, including all Aryth sub projects |
Aryth.Bounds |
Compute (min, max) for array and 2d-array |
Aryth.Calculator |
Parse algebraic expression and calculate |
Aryth.Comparer |
Comparer for array sort |
Aryth.Coord |
Functions for Descartes coordinates |
Aryth.Flopper |
Colorize array and 2d-array in terminal |
Aryth.Math |
Extend functions for float and double |
Aryth.NiceScale |
Compute (nice) scale for an array |
Aryth.Polar |
Functions for polar coordinates |
Aryth.Types |
Base types in Aryth series |
Aryth targets .NET Standard 2.0, fits both .NET and .NET Framework.
Install Aryth package and sub packages.
NuGet Package Manager:
Install-Package Aryth
.NET CLI:
dotnet add package Aryth
All versions can be found on nuget.
using Aryth.Calculator;
var expression = "3 + 4 * 2 / ( 1 - 5 ) ^ 2";
var result = expression.Calculate();
// result = 3.5
using Aryth.Bounds;
var samples = new[] { "foo", "bar", "zen", "16", "24", "32", "64" };
var (vector, bound) = vec.SoleBound();
// vector = [ NaN, NaN, NaN, 1, 2, 3 ]
// bound = ( 16, 64 )
using Aryth.Flopper;
var samples = new[] { "foo", "bar", "zen", "des" };
var flopper = FiniteFlopper<string>.From(samples);
Console.WriteLine($">> [next] {flopper.MoveNext()} {flopper.Current}"); // >> [next] True bar
Console.WriteLine($">> [next] {flopper.MoveNext()} {flopper.Current}"); // >> [next] True des
Console.WriteLine($">> [next] {flopper.MoveNext()} {flopper.Current}"); // >> [next] True foo
Console.WriteLine($">> [next] {flopper.MoveNext()} {flopper.Current}"); // >> [next] True zen
Console.WriteLine($">> [next] {flopper.MoveNext()} {flopper.Current}"); // >> [next] False zen
Aryth has a test suite in the test project.
Aryth is licensed under the MIT license.
Bug report and contribution are welcome at the GitHub repository.