public Vec2 smallestn(Vec2 b) { if (this.lengthSquared() > b.lengthSquared()) { return b; } else { return this; } }
public Vec2 biggestn(Vec2 b) { if (this.lengthSquared() < b.lengthSquared()) { return b; } else { return this; } }
@Override public int compareTo(Vec2 v) { if (this == v) { return 0; } else { float l = this.lengthSquared(); float vl = v.lengthSquared(); if (l < vl) { return -1; } else if (l == vl) { return 0; } else { return 1; } } }
public Vec2 projectn(Vec2 onthisv) { Vec2 n = dup(); n.project(onthisv); return n; }
public void smallest(Vec2 b) { if (this.lengthSquared() > b.lengthSquared()) { x = b.x; y = b.y; } }
public void biggest(Vec2 b) { if (this.lengthSquared() < b.lengthSquared()) { x = b.x; y = b.y; } }
public Vec2 setLengthn(float v) { Vec2 n = this.normalisen(); n.scale(v); return n; }
public Vec2 normalisen() { Vec2 n = this.dup(); n.normalise(); return n; }