func PlanarCentroid(a, b, c Point) Point {
	return Point{a.Add(b.Vector).Add(c.Vector).Mul(1. / 3)}
}
PlanarCentroid returns the centroid of the planar triangle ABC. This can be
normalized to unit length to obtain the "surface centroid" of the corresponding
spherical triangle, i.e. the intersection of the three medians. However, note
that for large spherical triangles the surface centroid may be nowhere near
the intuitive "center".
package s2
import (
	"math"
	"github.com/golang/geo/r3"
)
func TrueCentroid(a, b, c Point) Point {
	ra := float64(1)
	if sa := float64(b.Distance(c)); sa != 0 {
		ra = sa / math.Sin(sa)
	}
	rb := float64(1)
	if sb := float64(c.Distance(a)); sb != 0 {
		rb = sb / math.Sin(sb)
	}
	rc := float64(1)
	if sc := float64(a.Distance(b)); sc != 0 {
		rc = sc / math.Sin(sc)
	}
	x := r3.Vector{a.X, b.X - a.X, c.X - a.X}
	y := r3.Vector{a.Y, b.Y - a.Y, c.Y - a.Y}
	z := r3.Vector{a.Z, b.Z - a.Z, c.Z - a.Z}
	r := r3.Vector{ra, rb - ra, rc - ra}
	return Point{r3.Vector{y.Cross(z).Dot(r), z.Cross(x).Dot(r), x.Cross(y).Dot(r)}.Mul(0.5)}
}
func EdgeTrueCentroid(a, b Point) Point {
	vDiff := a.Sub(b.Vector)  
	vSum := a.Add(b.Vector)   
	sin2 := vDiff.Norm2()
	cos2 := vSum.Norm2()
	if cos2 == 0 {
		return Point{}  
	}
	return Point{vSum.Mul(math.Sqrt(sin2 / cos2))}  
}