public Vec cross(Vec v) { return new Vec(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x); }
public Vec plus(Vec v) { return new Vec(x+v.x, y+v.y, z+v.z); }
public Vec norm() { return mag()==0 ? this : div(mag()); }
- public Vec times(Matrix m) { return m.apply(this); }
public float mag() { return (float)Math.sqrt(x*x+y*y+z*z); }
public float dot(Vec v) { return x*v.x + y*v.y + z*v.z; }
public Vec times(float mag) { return new Vec(x*mag, y*mag, z*mag); }