def subdivide_cubic_bezier(p1,p2,c1,c2,t):
	"""Subdivide a cubic bezier curve and return the point on the curve plus new control points"""

	one_minus_t = 1.0 - t

	a = p1 * one_minus_t + c1 * t
	b = c1 * one_minus_t + c2 * t
	c = c2 * one_minus_t + p2 * t

	m = a * one_minus_t + b * t 
	n = b * one_minus_t + c * t

	p = m * one_minus_t + n * t

	return a,m,p,n,c