" 6/30/10 stupid idea 247: worlds smallest vector maths library Here is a tiny 3d vector maths library:
typedef float vec3[3]; vec3 *vec(vec3 *v, float x) {v[0]=v[1]=v[2]=x;return v;} float *mav(vec3 *v1,vec3 *v2,vec3 *v3,vec3 *v4,vec3 *v5){ for (int i=0; i!=3; i++) v3[i]=v1[i]*v4[i]+v2[i]*v5[i]; return v3[0]+v3[1]+v3[2]; } vec3 VZERO={0,0,0}; vec3 VONE={1,1,1}; vec3 VMONE={-1,-1,-1};
Thats it. It can do zero, set, add, sub, length2, dotprod, negate, lerp, centroid. e.g add is : mav(&v1, &v2, &v3, &VONE, &VONE ); v3=v2+v1
Lerp means that centroid (the centre vertex of a quad) can be found without a division by using two lerps. For a moment it seems cool until you realise the calls to it dont compress all that well. The challenges remaining are xprod, normalise and max/min. then I have everything for handling my 3d modeller qoob.If I can make minor adjustments to get those, this might be worth persuing. "
-- [1]
the author is trying to make a small (or compressible) CGI file format and renderer for demo intros. But for us the most notable thing here is the list of vector math library functions that e considers important:
---
https://github.com/japaric/steed
rec. by [2]
"
Current functionality
Check the API docs, but to summarize the functionality that interfaces with the Linux kernel:
Standard I/O (stdin, stdout, stderr)
File I/O
Filesystem operations (std::fs)
std::net: TCP, UDP. lookup_host is missing.
Dynamic memory allocation (thanks to ralloc!)
std::time
Minimal thread support.
Yup, that's all! I did say it was very early days, didn't I? "
https://japaric.github.io/steed/steed/index.html
---
" In its minimum configuration, SQLite requires only the following routines from the standard C library:
memcmp()
memcpy()
memmove()
memset() strcmp()
strlen()
strncmp() In a more complete build, SQLite also uses library routines like malloc() and free() and operating system interfaces for opening, reading, writing, and closing files. "
---
rec. by [3]