All Projects → sungiant → abacus

sungiant / abacus

Licence: MIT license
📐 C# cross precision 3D maths library.

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to abacus

zalgebra
Linear algebra library for games and real-time graphics.
Stars: ✭ 129 (+268.57%)
Mutual labels:  math, matrix, quaternion, vectors
Sharpmath
A small .NET math library.
Stars: ✭ 36 (+2.86%)
Mutual labels:  math, matrix, matrices
hlml
vectorized high-level math library
Stars: ✭ 42 (+20%)
Mutual labels:  math, matrix, quaternion
SCNMathExtensions
Math extensions for SCNVector3, SCNQuaternion, SCNMatrix4
Stars: ✭ 32 (-8.57%)
Mutual labels:  math, matrix, quaternion
Numphp
Mathematical PHP library for scientific computing
Stars: ✭ 120 (+242.86%)
Mutual labels:  math, matrix
Aardvark.base
Aardvark is an open-source platform for visual computing, real-time graphics and visualization. This repository is the basis for most platform libraries and provides basic functionality such as data-structures, math and much more.
Stars: ✭ 117 (+234.29%)
Mutual labels:  math, matrices
Calc
C-style arbitrary precision calculator
Stars: ✭ 127 (+262.86%)
Mutual labels:  math, matrices
Math Php
Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
Stars: ✭ 2,009 (+5640%)
Mutual labels:  math, matrix
Notecalc3
NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.
Stars: ✭ 879 (+2411.43%)
Mutual labels:  math, matrix
Mathjs
An extensive math library for JavaScript and Node.js
Stars: ✭ 11,861 (+33788.57%)
Mutual labels:  math, matrices
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (+408.57%)
Mutual labels:  math, matrix
Algebra
means completeness and balancing, from the Arabic word الجبر
Stars: ✭ 92 (+162.86%)
Mutual labels:  math, matrix
Maths
Linear algebra library with vector swizzling, intersection tests and useful functions for games and graphics dev.
Stars: ✭ 69 (+97.14%)
Mutual labels:  math, matrix
FixedPointsArduino
A fixed point arithmetic library for Arduino
Stars: ✭ 68 (+94.29%)
Mutual labels:  maths, fixed-point
mathcore
Advanced .NET math library (.NET Standard).
Stars: ✭ 24 (-31.43%)
Mutual labels:  math, matrices
Hlslpp
Math library using hlsl syntax with SSE/NEON support
Stars: ✭ 153 (+337.14%)
Mutual labels:  math, matrix
PyGLM
Fast OpenGL Mathematics (GLM) for Python
Stars: ✭ 167 (+377.14%)
Mutual labels:  matrix, quaternion
MachineLearning
An easy neural network for Java!
Stars: ✭ 125 (+257.14%)
Mutual labels:  matrix, matrices
Surge
A Swift library that uses the Accelerate framework to provide high-performance functions for matrix math, digital signal processing, and image manipulation.
Stars: ✭ 4,945 (+14028.57%)
Mutual labels:  math, matrix
Cglm
📽 Highly Optimized Graphics Math (glm) for C
Stars: ✭ 887 (+2434.29%)
Mutual labels:  math, matrix

Abacus

Build Status License Nuget Version Nuget Downloads

Overview

Abacus is a zero-dependency cross-precision 3D maths library for .NET, Mono and .NET Core. Abacus provides implementations for 32 bit and 64 bit fixed point Q numbers and provides common 3D maths types consistently across both fixed and floating point precisions.

The rationale around building Abacus is rooted in the development of deterministic game simulations.

Documentation for Abacus can be found here.

Supported types

Abacus provides implementations of the following common 3D maths data types:

  • Vector2
  • Vector3
  • Vector4
  • Matrix44
  • Quaternion

consistently across the following precisions:

  • Single (float)
  • Double (double)
  • Fixed32 (Q16.16)
  • Fixed64 (Q40.24)

Getting started

Abacus is available as a stand-alone library via nuget.

Alternatively, all code associated with each supported level of precision is generated into a single C# source file - this makes it easy to simply copy the appropriate Abacus.###.cs file.

Example usage

Abacus makes it easy to switch/test the precision used by a block of code as the API is consitent across all supported precisions - simply use the appropriate namespace:

//using Abacus.SinglePrecision;
//using Abacus.DoublePrecision;
using Abacus.Fixed32Precision; // selected precision
//using Abacus.Fixed64Precision;

class Program {
    public static void Main (string[] args) {
        var a = new Vector2 (-100, +50);
        var b = new Vector2 (+90, -70);
        var c = new Vector2 (-20, +5);
        var d = new Vector2 (+30, -5);
        Vector2 result = Vector2.CatmullRom (a, b, c, d, 0.4);
    }
}

Details

    +Y
     |
     |
     |______ +X     * X: right
    /               * Y: up
   /                * Z: backwards
 +Z
  • Abacus uses a right handed coordinate system.
  • Angles of rotation are measured anti-clockwise when viewed from the rotation axis (positive side) toward the origin. Right handed rule for rotations - thumb pointing along the axis of rotation, away from the origin.
  • Cameras are aligned with the main coordinate system and look in the direction of their negative Z axis (just like OpenGL).
  • Near and far planes are defined by their Z positions in view-space, not as their distance from the camera in view space. This means they will be negative in the general case.
  • Normalised device coordinates are inline with the main coordinate system and range from -1 to 1 on all axes.
  • Abacus has been built using T4 text templatization as there is limited support for expressing generic type constraints in C#.
  • Fixed point Q numbers in Abacus can be easily customised by adjusting the code generation logic.

Contributing

If you find a bug or have an issue please reach out via the GitHub Issue tracking system. Feel feel to submit PR with improvements.

License

Abacus is licensed under the MIT License; you may not use this software except in compliance with the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].