# How to check if other points are on the geodesic between 2 points on a sphere?

Given any 2 points $$p_1, p_2 \neq p_1$$ on a sphere, how can we check if $$p_3$$ is on the geodesic from $$p_1$$ to $$p_2$$?

I think of checking the $$||\text{arc } p_1 p_3|| + ||\text{arc } p_3 p_2|| = ||\text{arc } p_1 p_2||$$. Is this condition sufficient? Any other suggestions?

1. Evaluate the following double integral $$\int_{0}^{\frac{\pi}{2}} \int_{0}^{\pi}\left(x^{2} \cos y-\sin x\right) d x d y$$