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