public boolean isCollinearWith(Vector other) {
        if (this.isZero() || other.isZero()) return true;
        if (this.absoluteOffset(other).isZero()) return true;

        double x2 = other.x;
        double y2 = other.y;
        double z2 = other.z;

        if ((x == 0) != (x2 == 0) || (y == 0) != (y2 == 0) || (z == 0) != (z2 == 0))
            return false;

        double x3 = x2 / x;
        if (!Double.isNaN(x3))
            return other.equals(this.clone().multiply(x3));

        double y3 = y2 / y;
        if (!Double.isNaN(y3))
            return other.equals(this.clone().multiply(y3));

        double z3 = z2 / z;
        return !Double.isNaN(z3) && other.equals(this.clone().multiply(z3));
    }