Point topCenter(Point origin)

The point at the center of the top edge of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.

See also Rect.topCenter.

Source

Point topCenter(Point origin) => new Point(origin.x + width / 2.0, origin.y);