normalize static method
Implementation
static void normalize(Vec2D result, Vec2D a) {
double x = a[0];
double y = a[1];
double len = x * x + y * y;
if (len > 0.0) {
len = 1.0 / sqrt(len);
result[0] = a[0] * len;
result[1] = a[1] * len;
}
}