def bezier_subdivide(cp, t):
 (c00, c01, c02, c03) = cp
 c10 = ((c00 * (1 - t)) + (c01 * t))
 c11 = ((c01 * (1 - t)) + (c02 * t))
 c12 = ((c02 * (1 - t)) + (c03 * t))
 c20 = ((c10 * (1 - t)) + (c11 * t))
 c21 = ((c11 * (1 - t)) + (c12 * t))
 c30 = ((c20 * (1 - t)) + (c21 * t))
 first = [c00, c10, c20, c30]
 second = [c30, c21, c12, c03]
 return (first, second)

def bezier_subdivide ( cp , t ) : ( c00 , c01 , c02 , c03 ) = cp c10 = ( ( c00 * ( 1 - t ) ) + ( c01 * t ) ) c11 = ( ( c01 * ( 1 - t ) ) + ( c02 * t ) ) c12 = ( ( c02 * ( 1 - t ) ) + ( c03 * t ) ) c20 = ( ( c10 * ( 1 - t ) ) + ( c11 * t ) ) c21 = ( ( c11 * ( 1 - t ) ) + ( c12 * t ) ) c30 = ( ( c20 * ( 1 - t ) ) + ( c21 * t ) ) first = [ c00 , c10 , c20 , c30 ] second = [ c30 , c21 , c12 , c03 ] return ( first , second )
subdivide a cubic bezier curve defined by the control points cp .