[docs]defreflect_over_XZ_plane(input_vector):""" Takes in a vector or an array and flips the y-coordinates. :param input_vector: A vector or list of vectors to flip. :return: Vector with flipped sign on y-coordinate. """ifnotis_casadi_type(input_vector):shape=input_vector.shapeiflen(shape)==1:returninput_vector*np.array([1,-1,1])eliflen(shape)==2:ifnotshape[1]==3:raiseValueError("The function expected either a 3-element vector or a Nx3 array!")returninput_vector*np.array([1,-1,1])else:raiseValueError("The function expected either a 3-element vector or a Nx3 array!")else:ifinput_vector.shape[1]==1:returninput_vector*np.array([1,-1,1])elifinput_vector.shape[1]==3:returnnp.stack((input_vector[:,0],-1*input_vector[:,1],input_vector[:,2],),axis=1,)else:raiseValueError("This function expected either a 3-element vector or an Nx3 array!")