# Integrate linear function over spherical triangle

In the plane I can integrate a linear function over a triangle as the average of the corner values times the area of the triangle.

Then if I subdivide the triangle into 4 triangles by introducing a new node on each side of the original triangle, and linearly interpolate the value at the new nodes from the edge endpoints (=corners of the original triangle), the sum of the integrals of the sub-triangles is equal to the integral of the original triangle.

Now on the sphere, computing areas as spherical areas (like here), and computing the values at the new nodes on an arc of the original triangle by linear interpolation along the arc, this does not work any more. Computing the integral of the spherical triangles as the average of the corner values times the spherical triangle area, the integrals of the subtriangles do not sum up to the integral of the original triangle.

My suspicion is that I have to integrate the function which is linear over a spherical triangle in some other way, i.e. that the average-of-corner-values- times-area rule is not valid on the sphere. Does someone know how to compute this integral?

Also I wonder now if a 'function linear over a spherical triangle' is even defined? I think it should fulfil the property to be linear along any arc contained in the triangle. Then it would be linear along the arc between two new nodes which connects two subtriangles and the integrals of the subtriangles should add up to the big triangle.

Edit:

Since Willie's comment confirmed my suspicion that I cannot just define a function that is linear over a spherical triangle, let me change the question to:

Given a spherical triangle, subdivide the triangle by bisecting the edges and set the value at the new nodes as the average of the edge endpoints. Recursively repeat this procedure for the sub-triangles. Repeating this subdivision to infinity should prescribe a function dense on the spherical triangle. Is it possible to find an analytic expression for the integral of this function given the values at the nodes of the original triangle?

• Your suspected definition of "linear function over a spherical triangle" won't work, basically because of the failure of the parallel postulate in spherical geometry. In general linearity is only a well-defined concept over a vector (or affine) space (or subsets thereof). – Willie Wong Apr 26 '12 at 16:10
• Surely the answer to your edited question would be that it's just the original average, by induction over the level of subdivision? Or am I missing something? – Peter Taylor Apr 26 '13 at 23:20
• @PeterTaylor I'm not sure. Since it is a spherical triangle, the edges are arcs, and the 4 small triangles after subdivision have a different area each. It might be true that the integral is just spherical area times average of node values, but it is not obvious to me. – Matthias 009 May 1 '13 at 14:45

A relatively straighforward way to see that there's no such thing as a linear function on a spherical triangle is to consider a triangle with three right angles, say, at $(1,0,0)$, $(0,1,0)$ and $(0,0,1)$ on the unit sphere. By symmetry, the function value at $(1,1,1)/\sqrt3$ should be the average of the function values at the corners. On the other hand, interpolating linearly along two arcs, we get that $f(0,1/\sqrt2,1/\sqrt2)=(f(0,1,0)+f(0,0,1))/2$ and then
$$\begin{eqnarray} f(1/\sqrt3,1/\sqrt3,1/\sqrt3) &=& \frac2\pi\left(\arccos\sqrt\frac23f(1,0,0)+\arccos\sqrt\frac13f(0,1/\sqrt2,1/\sqrt2)\right) \\ &=& \frac1\pi\left(2\arccos\sqrt\frac23f(1,0,0)+\arccos\sqrt\frac13\left(f(0,1,0)+f(0,0,1)\right)\right) \\ &\approx&0.392f(1,0,0)+0.304f(0,1,0)+0.304f(0,0,1)\;. \end{eqnarray}$$