Bezier function in MatUtils