public Point diff(Point p) { p = p.toUnit(unit); p.x -= x; p.y -= y; p.z -= z; return p; }
public void translateI(Point delta) { if (delta.unit != unit) { delta = delta.toUnit(unit); } x += delta.x; y += delta.y; z += delta.z; }
public double distance2(Point p) { if (p.unit != unit) { p = p.toUnit(unit); } return (p.x - x) * (p.x - x) + (p.y - y) * (p.y - y) + (p.z - z) * (p.z - z); }
public double distance(Point p) { if (p.unit != unit) { p = p.toUnit(unit); } return Math.sqrt((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y) + (p.z - z) * (p.z - z)); }