General solution of a three-body problem in the plane