Source

simelo-math / lib / triangle.euk

Full commit

% Common lines and points in triangles

% The center of the excircle opposite the vertex A
%
point excircle_center(point A, point B, point C)
  local ba, bb
  ba = bisector(line(A, B), line(A, C))
  bb = perpendicular(bisector(line(B, A), line(B, C)), B)
  return intersection(ba, bb)
  end

% The excircle opposite the vertex A
%
circle excircle(point A, point B, point C)
  local ba, bb, excenter
  ba = bisector(line(A, B), line(A, C))
  bb = perpendicular(bisector(line(B, A), line(B, C)), B)
  excenter = intersection(ba, bb)
  return circle(excenter, distance(excenter, line(B,C)))
  end