Use the standard library where possible:
stdlib.h defines these functions:
int abs( int n );
long labs( long n );
long long llabs( long long n ); // (since C99)
and math.h defines these functions:
float fabsf( float arg ); // (since C99)
double fabs( double arg );
long double fabsl( long double arg ); // (since C99)
// and sqrtf() et cetera.
Consider using them instead of rolling out your own. See also: Pitfalls of function-like macros
Simplify:
float Vector2D_DotProduct(Vector2D a, Vector2D b)
{
#if 0
float dp = a.x*b.x+a.y*b.y;
return dp;
#else
return a.x * b.x + a.y * b.y;
#endif
}
Vector2D Vector2DSubtract(Vector2D a, Vector2D b)
{
#if 0
Vector2D v;
v.x = a.x - b.x;
v.y = a.y - b.y;
return v;
#else
return (Vector2D) {.x = a.x - b.x, .y = a.y - b.y};
#endif
}
See: Compound Literals.