The shape invariant of triangles and trigonometry in two-point homogeneous spaces