import math


def arc_midpoint(x1, y1, x2, y2, angle):
	"""
		Grab point on arc that is the midpoint between points 1 and 2.
	"""
	theta = angle / 2
	tan2theta = math.atan2(y2-y1, x2-x1) - math.pi/2
	d = math.sqrt((x2-x1)**2 + (y2-y1)**2)
	delta = (1 - math.cos(theta)) * 0.5*d / math.sin(theta)

	xm = 0.5*(x2+x1) + delta * math.cos(tan2theta)
	ym = 0.5*(y2+y1) + delta * math.sin(tan2theta)

	return xm, ym