public static scalar length(this vec2 v) => v.Length;
public static vec2 normalize(vec2 v) { float sqr = v.x * v.x + v.y * v.y; return(v * (1.0f / (float)Math.Sqrt(sqr))); }
public vec2(vec2 v) { this.x = v.x; this.y = v.y; }
public static float dot(vec2 x, vec2 y) { vec2 tmp = new vec2(x * y); return(tmp.x + tmp.y); }
public vec3(vec2 xy, float z) { this.x = xy.x; this.y = xy.y; this.z = z; }