A Characteristic Function in Riemannian Space and its Application to the Solution of Geodesic Triangles