Consider the average length of a line segment determined by two points picked at random in the interior of an arbitrary triangle with side lengths , , and . This problem is not affine, but a simple formula in terms of the area or linear properties of the original triangle can be found using Borel's overlap technique to collapse the quadruple integral to a double integral and then convert to polar coordinates, leading to the beautiful general formula
(1)

(A. G. Murray, pers. comm., Apr. 4, 2020), where is the semiperimeter and . The formulas for odd moments have a similar form to that of the mean but with higher powers of , , , and the triangle area .
This formula immediately gives the special cases obtained below originally using bruteforce computer algebra.
If the original triangle is chosen to be an equilateral triangle with unit side lengths, then the average length of a line with endpoints chosen at random inside it is given by
(2)
 
(3)

The integrand can be split up into the four pieces
(4)
 
(5)
 
(6)
 
(7)

As illustrated above, symmetry immediately gives and , so
(8)

With some effort, the integrals and can be done analytically to give the final beautiful result
(9)
 
(10)

(OEIS A093064; E. W. Weisstein, Mar. 16, 2004).
If the original triangle is chosen to be an isosceles right triangle with unit legs, then the average length of a line with endpoints chosen at random inside it is given by
(11)
 
(12)
 
(13)
 
(14)

(OEIS A093063; M. Trott, pers. comm., Mar. 10, 2004), which is numerically surprisingly close to .
The mean length of a line segment picked at random in a 3, 4, 5 triangle is given by
(15)
 
(16)
 
(17)

(E. W. Weisstein, Aug. 69, 2010; OEIS A180307).
The mean length of a line segment picked at random in a 306090 triangle with unit hypotenuse was computed by E. W. Weisstein (Aug. 5, 2010) as a complicated analytic expression involving sums of logarithms. After simplification, the result can be written as
(18)
 
(19)

(E. Weisstein, M. Trott, A. Strzebonski, pers. comm., Aug. 25, 2010; OEIS A180308).
The expected distance from a random point in a general triangle to the vertex opposite the side of length is
(20)

(A. G. Murray, pers. comm., Apr. 4, 2020), with analogous expressions for and . These give the beautiful identity
(21)

(A. G. Murray, pers. comm., Apr. 4, 2020).