assert(Vec2(0, 0).magnitudeSquared() == 0); assert(Vec2(1, 0).magnitudeSquared() == 1); assert(Vec2(0, 1).magnitudeSquared() == 1); assert(Vec2(1, 1).magnitudeSquared() == 2); assert(Vec2(2, 0).magnitudeSquared() == 4); assert(Vec2(1, 2).magnitudeSquared() == 5);
Returns the squared magnitude (Euclidean length) of a Vector.