incenter property

Point get incenter

Get incenter of this triangle

The intersection of angle bisectors, weighted by opposite side lengths.

Implementation

Point get incenter {
  final la = BC.length; // side opposite vertex a
  final lb = CA.length; // side opposite vertex b
  final lc = AB.length; // side opposite vertex c
  final p = la + lb + lc;
  return Point(
    (la * a.x + lb * b.x + lc * c.x) / p,
    (la * a.y + lb * b.y + lc * c.y) / p,
  );
}