Vectors in mathematics. Vector3. Vector2

Normalized vector 2d: var d=1/Math.sqrt(dx*dx+dy*dy); dx*=d; dy*=d;