Prove that $c^2=a^2+b^2-2ab\cos\left(C-\frac{KS}{3}\right)$ holds on a smooth surface. 
Problem: Given a infinitely small geodesic triangle $\triangle ABC$ on a smooth surface, denote the corresponding edges as $a,b,c.$ Prove: the area of $\triangle ABC$ (denote as $S$) and the Gauss curvature on $C$ ( denote as $K$) satisfies

$$c^2=a^2+b^2-2ab\cos\left(C-\frac{KS}{3}\right).$$
Since the triangle is infinitesimal, therefore it is naturally to use the first fundamental form and the Gauss-Bonnet theorem. However, I got stuck at how to handle the $\frac{KS}{3}$ in the equation. Since the coefficient is $\frac{1}{3}$, if using Gauss-Bonnet theorem, we would include new variables $\angle A,\angle B$. Could anyone help me out? Thanks a lot in advance!

Comment @ robjohn : Can we check  for both signs of const $K?$
So for constant $K$ approximation we have $ \cos \tilde C$
$$= \cos (C+ \dfrac{KS}{3})= \cos (C\pm \dfrac{A+B+C-\pi}{3}) $$
K>0
For an equilateral spherical triangle $( a=b=c,A=B=C=\pi/2) $
$$\text{RHS}=\cos 2 \pi/3= -\dfrac12$$
$$ c^2= a^2+b^2+ab = 3 a^2 \to c= {\sqrt 3 a}, \text{ a contradiction }$$
K<0
For an equilateral  hyperbolic  spiky triangle $(A=B=C=\pi/6,a=b=c),$
$$ = \cos ( \dfrac{4C+A+B-\pi}{3}) = \cos (\dfrac{2C-A-B+\pi}{3}), $$
$$\text{RHS}=\cos \pi/3= \dfrac12$$
$$ c^2= a^2+b^2-ab = a^2 ,\; c=a.$$
Please comment what I am missing here in the K>0 approximation.
