\text{Drag point } P \text{ to set the distance-sum for the tri-ellipse.}

A = (2.940265591216484, 4.0098570699422496)
B = (5.021486925260736, 1.9671768717136344)
C = (2.150172306995981, 1.7166594889120117)
f = Line(J, K)
L = Point(f)
O = (-1.1465480982052008, 6.0356426363658215)
N = (2.1397267708127834, 6.0356426363658215)
j = Ray(O, N)
P = Point(j)
l = Segment(O, P)
D = Point(l)
g = Segment(D, P)
E = Midpoint(g)
h = Segment(D, E)
c = Circle(A, h)
d = Circle(B, h)
F = Intersect(c, d, 2)
e = Ellipse(A, B, F)
i = Segment(O, D)
k = Circle(C, i)
G = Intersect(e, k, 3)
H = Intersect(e, k, 4)
I = Intersect(e, k, 2)
P_1 = Intersect(e, k, 1)
loc1 = Locus(G, D)
loc2 = Locus(H, D)
loc3 = Locus(I, D)
loc4 = Locus(P_1, D)