public bool quad_to_square(double[] q) { if (!square_to_quad(q)) return false; invert(); return true; }