added anglebetween to vmathf

This commit is contained in:
Sara 2023-10-23 21:52:44 +02:00
parent 1f56608950
commit fa2ca7241c

View file

@ -120,6 +120,10 @@ Vector vrotatef(Vector a, float t) {
};
}
static inline
float vanglebetweenf(Vector a, Vector b) {
return vdotf(a, b) / (vmagnitudef(a) * vmagnitudef(b));
}
static inline
Vector vprojectf(Vector onto, Vector from) {
float dot = vdotf(onto, from);
return vmulff(onto, dot);