9th-circle / Anathema.Vectors

Basic linear algebra, mostly for computer graphics.
Other
4 stars 1 forks source link

Anathema Vectors

Basic linear algebra, mostly for computer graphics.

Why?

System.Numerics contains a native SIMD-enabled Vector class. It's extremely fast and is what most developers would expect. Why not just use that?

Anathema Vectors has a few benefits:

Approach

Notation

d = double precision floating point data type

f = single precision floating point data type

t = generic (template) defined data type

mat = matrix

vec = vector

quat = quaternion

Number at end = number of components (per row/column for matrices).

So, for example, dmat2 = double precision floating point 2x2 matrix.

Or, tvec3<int> = 32-bit integer 3-component vector.

Nested Template Vectors

Swizzles

Gotchas/Limitations

Complex Numbers and Quaternions

Todo: fill out

Compile-Time Flags

FLOATS_ENABLED
DOUBLES_ENABLED
NESTING_ENABLED
TEMPLATES_ENABLED
SWIZZLES_ENABLED
COLOURS_ENABLED
COMPLEX_ENABLED
CONVERSIONS_ENABLED
INTERPOLATION_ENABLED
THREED_ENABLED
TEMPLATE_OPERATIONS_ENABLED
TEMPLATE_DIVISION_ENABLED
CAPITALS_ENABLED

Special Thanks