tSegs startTriangle TSelf Segments pSeg Segment startTriangle TSelf Ce

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tSegs := startTriangle.TSelf.Segments()
pSeg := Segment{p, startTriangle.TSelf.Centre()}
ind := -1
for i, tSeg := range tSegs {
if pSeg.Intersects(tSeg) {
ind = i
break
}
}