so now it is shared way to early it's kind of in jeopardy :/ that's how it goes. code at https://github.com/xloem/surface . the vector microlibrary is in surface/vector.h and attached. it has no comments so i am describing the sections. the design choices are kind of arbitrary. other people would do this differently. at the top three structures are defined for vec2, vec3, and vec4. below these basic directional constants are defined for each sized vector, each has a name in full caps. then there is a definition of internal kernel utility macros, _def_kernel_ov makes a set of unary operations, and _def_kernel_olr makes a set of binary operations. these are the near-largest shared logic between all operations implementations, pulled into two macros. below these two macros we have public operation definition macros with names like def_kernel_outNleftNrightN . these call sequences of the previous macros to perform various implementations for different operator norms with different sized vectors or scalars. i iterated different sets of macros to get something useful and somewhat appropriate that combined the repetition. more tweaks could happen as or if the operators expand for example to include 2 dimensional data, but i might separate that into a different area if i get that far. then below the macro definition sections we have operation definitions that use them, sorted by the size of data input and output. vector norm, negation, complex conjugates, arithmetic. these are all parallel across all the vector sizes. then we have custom operator implementations for operations that only apply to one kind of vector, sorted by size, first 2d complex numbers, then 3d points, then 4d quaternions and versors. this section could be more similar to the previous section if i took some time to figure out how to organize macros that only applied to one vector size, and to look for algorithmic patterns in the various implementations. the quaternion and versor formula are mostly taken from wikipedia. it's all untested still so it certainly is full of mistakes and errors. this sure is different after sharing. i would like to implement basic tesselation and a mesh structure next. the long term goal or idea is to make a library for modeling simple objects, notably a holder for my phone which keeps falling while i drive. i'd like to make it in different languages, like python and javascript as well as c, to be generally useful.