Given the two points, we know how to calculate the shortest distance between them, and the bearing from one point, in order to reach the other point.
Also, we know the loxodromic distance between them, and the corresponding bearing. In this article, the calculation is explained.
Now I would like to know how to calculate the distance when the bearing is given. This hypothesis means also that you have to give the "straight" road given the bearing, we can suppose that the road is obtained by cutting the sphere with a plan, on the two points. If I am not wrong, you have a unique cut, given the bearing and the two points.