1. Let the midpoint of a line segment (in your case it is a diameter). Then your formula becomes:

2. You must know the coordinates of 2 points to calculate the coordinates of the third one. For instance: If you know the coordinates of the midpoint and the coordinates of then you have to solve the equations for respectively for