Solve for a a=1/2h(c+d)