>>535593824
[code]
float dot(float *a, float *b)
{
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
float len(float *v)
{
return sqrtf(dot(v, v));
}
float dist(float *a, float *b)
{
float c[3] = {a[0] - b[0], a[1] - b[1], a[2] - b[2]};
return len(c);
}
float angle(float *a, float *b)
{
return dot(a, b) / len(a) * len(b);
}
[/code]
took me literally few minutes to type out but attaching a bosci took most of the time