return deg * VG_PIf / 180.0f;
}
+/* angle to reach b from a */
+static f32 vg_angle_diff( f32 a, f32 b ){
+ f32 d = fmod(b,VG_TAUf)-fmodf(a,VG_TAUf);
+ if( fabsf(d) > VG_PIf )
+ d = -vg_signf(d) * (VG_TAUf - fabsf(d));
+
+ return d;
+}
+
/*
* quantize float to bit count
*/
v3_add( v1, v2, d );
}
+static f32 q_dist( v4f q0, v3f q1 ){
+ return acosf( 2.0f * v4_dot(q0,q1) -1.0f );
+}
+
/*
* -----------------------------------------------------------------------------
* Section 4.a 2x2 matrices