@Override public Vector2 mul(ImmutableVector<Vector2> b) { Vector2 sum = b.clone(); x *= sum.x; y *= sum.y; return this; }
// interface methods @Override public Vector2 add(ImmutableVector<Vector2> b) { Vector2 sum = b.clone(); x += sum.x; y += sum.y; return this; }
@Override public Vector2 max(ImmutableVector<Vector2> b) { Vector2 sum = b.clone(); x = Math.max(x, sum.x); y = Math.max(y, sum.y); return this; }
@Override public Vector2 div(ImmutableVector<Vector2> b) { Vector2 sum = b.clone(); x /= sum.x; y /= sum.y; return this; }
public Vector2(ImmutableVector v) { float[] c = v.getCoords(); if (c.length > 0) { x = c[0]; } if (c.length > 1) { y = c[1]; } }
@Override public float dot(ImmutableVector<Vector2> b) { Vector2 sum = b.clone(); return x * sum.x + y * sum.y; }