RecursiveAI.OneMath 1.0.0

dotnet add package RecursiveAI.OneMath --version 1.0.0
                    
NuGet\Install-Package RecursiveAI.OneMath -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RecursiveAI.OneMath" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RecursiveAI.OneMath" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RecursiveAI.OneMath" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RecursiveAI.OneMath --version 1.0.0
                    
#r "nuget: RecursiveAI.OneMath, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RecursiveAI.OneMath@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RecursiveAI.OneMath&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RecursiveAI.OneMath&version=1.0.0
                    
Install as a Cake Tool

RecursiveAI.OneMath

Deterministic math for .NET: vectors, matrices, quaternions, elementary functions and exact geometric predicates that give the same bits on every OS, CPU, runtime, WebAssembly mode and thread count. No dependencies beyond the .NET base class library; NativeAOT and trimming compatible.

using RecursiveAI.OneMath;

double s = Math64.Sin(1e300);                       // correctly rounded, same on every platform
int side = ExactPredicates.Orient2D(0, 0, 1, 0, 0.5, 1e-10);   // +1, -1 or 0, never wrong
long raw = FixedBridge.FromDouble(1.5);            // Q31.32 fixed point <-> double, exact within +-2^21
  • Types: Vector2/3/4, Matrix2x2/3x3/4x4, Quaternion, Affine3, RigidTransform, Bounds2/3, each in float (F) and double (D) form, with a documented evaluation order.
  • Functions: Math32 and Math64 — sin, cos, tan, asin, acos, atan, atan2, exp, exp2, expm1, log, log2, log10, log1p, pow, cbrt, hypot, sinh, cosh, tanh — correctly rounded (the nearest float or double to the exact result).
  • Exact predicates: ExactPredicates (Orient2D, Orient3D, InCircle, InSphere) and SegmentPredicates, adaptive with exact fallback (after Shewchuk 1997). Coordinates must be finite and either zero or of magnitude in [2^-140, 2^200]; out-of-range input may throw ArgumentOutOfRangeException.
  • Fixed-point bridge: FixedBridge converts Q31.32 integers to and from double, exact for magnitudes below 2^21 and rejecting beyond.
  • Physics math: symmetric 3x3 eigen decomposition and inertia tensors in RecursiveAI.OneMath.Physics.

Matrix convention.

Matrices use column vectors: m * v transforms the column v, the translation of a 4x4 sits in column 4 (M14, M24, M34), and a * b applies b first. System.Numerics is the opposite: row vectors, translation in M41..M43, and a * b applies a first, although the field names Mrc are the same. Porting by copying fields, or keeping operand order, silently gives a different transform. Translate then rotate:

// System.Numerics (row vectors): T first, then R
var sn = System.Numerics.Matrix4x4.CreateTranslation(10, 0, 0) * System.Numerics.Matrix4x4.CreateRotationY(angle);
// OneMath (column vectors): the same transform is R * T
var m = Matrix4x4F.CreateRotationY(angle) * Matrix4x4F.CreateTranslation(new Vector3F(10, 0, 0));
// Convert instead of copying fields: both directions transpose
Matrix4x4F same = Matrix4x4F.FromSystemNumerics(sn);   // same transform as m
System.Numerics.Matrix4x4 back = m.ToSystemNumerics();

Vectors and quaternions convert with FromSystemNumerics / ToSystemNumerics too (quaternions keep their components and their Hamilton product). Converting from double to float is only available as the explicit ToSystemNumerics() and rounds to nearest even.

Stable. The public API follows semantic versioning from 1.0.0. Results are checked against exact references and compared across x64, arm64 and WebAssembly in the repository's hash matrix.

Full documentation, the normative notes and the changelog: https://github.com/recursive-ai-oss/onemath-csharp/blob/main/README.md. Licensed under MIT or Apache-2.0, at your option.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on RecursiveAI.OneMath:

Package Downloads
RecursiveAI.OnePath

Deterministic pathfinding and navigation for .NET: square, hex and voxel grids (A*, JPS, Theta*, HPA*, D* Lite, flow fields), graphs, tiled navigation meshes with 2D and 3D builders and queries, and ORCA crowds. Bit-identical results on every platform and across every release of a major version.

RecursiveAI.OnePhysics

Deterministic 2D and 3D rigid-body physics for .NET with identical results on every platform.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 488 10/28/2026
0.1.0-preview.5 308 10/28/2026

See CHANGELOG.md in the repository.