Solving the Inverse Problem of Electrocardiography