centroid property

  1. @override
Point<double> get centroid
override

The mathematical center of mass of the shape.

Implementation

@override
Point<double> get centroid {
  return Point(
    x: (p1.x + p2.x + p3.x) / 3.0,
    y: (p1.y + p2.y + p3.y) / 3.0
  );
}