#JavaScript (ES7), 80 74 66 65 bytes
JavaScript (ES7), 80 74 66 65 bytes
(a,b,c)=>(s=a+b+c,(p=a*b*c/s)*p/4*(s/=2)/(s-a)/(s-b)/(s-c)-p)**.5
###How?
How?
This is derived from:
- The semiperimeter \$s\$ of the triangle:
The semiperimeter \$s\$ of the triangle:
$$s=\frac{a+b+c}{2}$$
$$s=\frac{a+b+c}{2}$$
- The circumradius \$R\$ of the triangle:
The circumradius \$R\$ of the triangle:
$$R=\frac{abc}{4\sqrt{s(s-a)(s-b)(s-c)}}$$
$$R=\frac{abc}{4\sqrt{s(s-a)(s-b)(s-c)}}$$
- The product of the inradius \$r\$ and the circumradius:
The product of the inradius \$r\$ and the circumradius:
$$rR=\frac{abc}{2(a+b+c)}=\frac{abc}{4s}$$
$$rR=\frac{abc}{2(a+b+c)}=\frac{abc}{4s}$$
- Euler's theorem:
Euler's theorem:
$$d=\sqrt{R(R-2r)}=\sqrt{R^2-2rR}=\sqrt{R^2-\frac{abc}{2s}}$$
$$d=\sqrt{R(R-2r)}=\sqrt{R^2-2rR}=\sqrt{R^2-\frac{abc}{2s}}$$