Vim.Math3d alternatives and similar packages
Based on the "Mathematics" category.
Alternatively, view Math3D alternatives based on common mentions on social networks and blogs.
A set of tools for graph layout and viewing
5.4 0.0 Vim.Math3d VS AngouriMathNew open-source cross-platform symbolic algebra library for C# and F#. Can be used for both production and research purposes.
1.1 10.0 Vim.Math3d VS Jodo.NumericsSimple, reliable .NET libraries covering numbers, geometry and data structures
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Vim.Math3d or a related project?
Vim.Math3D is a portable, safe, and efficient 3D math library from VIM AEC written in C# targeting .NET Standard 2.0 without any dependencies.
It is intended primarily as a feature rich drop-in replacement for System.Numerics that assures consistent serialization across platforms, enforces immutability, and offers many additional structures and functionality.
Math3D is compatible with Unity and has been used in production on many different platforms including Windows, Android, iOS, WebGL, and Magic Leap.
In rough order, the Math3D design goals are:
- The library must be pure C#
- No unsafe code
- Fixed binary layout of structs in memory
- Double and Single precision implementation of most structures
- Functions are well covered by unit tests
- Functions are easy to read, understand, and verify
- Ease of Use and Discoverability
- Consistent with Microsoft coding styles
- Consistent API with System.Numerics
- Can use fluent syntax (object-oriented "dot" notation)
- We don't have to pass arguments by reference
- Excellent performance, but not at cost of readability and discoverability
VIM is a company that develops high-performance 3D applications for multiple platforms. Our core development language is C#, so we had a need for a robust, efficient, and productive 3D library. We originally started using System.Numerics, but we ran into some problems. The first issue was that with System.Numerics different implementations could have different binary layouts of the structures. For example a Vector3 might be aligned on either 12 or 16 byte boundaries depending on the platform.
Microsoft's recommendations around struct design are to make structs immutable. Oddly enough this is violated by the System.Numerics library.
By opting to make data types immutable by default eliminates large categories of bugs like race conditions, invariant violations after construction. This is another reason we decided to fork the System.Numerics library.
So we decided to start Math3D by forking from the core classes provided in the CoreFX implementation of System.Numerics with additional algorithms and structures taken from MonoGame, an open-source cross platform port of the XNA game development framework.
What Structs are Provided
The following is a list of data structures provided by Vim.Math
- Pseudo-Vectors - the following classes lack some of the operations of Vectors
- ColorRGB - Three byte representation of colors
- ColorHDR - High Defintion Range, 4 floating points
- Rotations and Transformations
- Transform - Position and Orientation
- Euler (Tait-Bryan)
- Geometric structures and shapes
- Interval Structures and Bounding
- Alternative Coordinate Representations
- SphericalCoordinate - Radius, Azimuth (bearing), and Inclination (elevation angle)
- PolarCoordinate - Radius and Azimuth (bearing)
- LogPolarCoordinate - Rho (log of radial distance) and Azimuth
- CylindricalCoordinate - Radius, Azimuth (bearing) and Height
- HorizontalCoordinate - Azimuth (bearing) and Inclination
- GeoCoordinate - Latitude and Longitude
- LinearMotion - Velocity, Acceleration, and Scalar Friction
- AngularMotion - Velocity, Acceleration, and Scalar Friction
- Motion - LinearMotion and AngularMotion
In addition to many specialized functions for the various data type all structs provide the following functionality:
- Constructor from value tuple
bool Equals(object other)
bool AlmostEquals(T other, float tolerance)
static T Create(...)
- implicit cast operator to and from value tuples
static T Zeroproperty
static T MinValueproperty
static T MaxValueproperty
Every vector struct also provides the additional functionality:
- Unary negation operator
Every interval struct contains the following:
- Operators + and -
System.Math as Extension Functions,
In addition All of the
System.Math routines are implemented as static extension functions
DVector4. This provides a convenient fluent syntax on all variables making the Vim.Math3D API
easily discoverable using auto-complete.
What are .TT Files
Vim.Math3D leverages the T4 text template engine
to auto-generate efficient boilerplate code for the different types of
structs. This has proven for us to be an effective way to create generic code that is also very efficient for numerical types and
reduce the overhead of maintainance.
About the Tests
Vim.Math3D uses NUnit for the tests, which many were ported from the CoreFX Numerics implementation of System.Numerics. At last measure we have approximately 50% code coverage, with most of the uncovered functions having trivial implementations that are auto-generated using the T4 templating engine.
- SharpDX Mathematics
- Math.NET Spatial
- Math.NET Numerics
- Unity Reference
- A Vector Type for C# - R Potter via Code Project
- Godot Engine C# Libraries
- GeometRi - Simple and lightweight computational geometry library for .Net