Since P and Q are located on the same longitudinal line (=great circle) you only have to calculate the difference of the latitudes:

Let R denote the radius of the earth. Then the distance between P and Q is calculated by:

The second example has to be calculated similarly because the points are located on a great circle (=equator) too.