Calculate position of the center of a face

Hi guys, I’m working on a tool project. It’s a sandbox for setting up scenarios to teach lessons. One of the things the user will be able to do is create volumes of varying shapes(example would be defining a volume of airspace that particular aircraft should be in). Right now it starts them off with a cube and I allow them to select and extrude the faces as they wish. Currently it’s just extruding with a button press. What I’d like to do is place a widget-like object in the center of the selected face. I’m not sure how to calculate that point in local space nor world space. Are there any links anyone can hook me up with? Or anyone who already knows how?

Any help is much appreciated.

PS It won’t always be a cube depending on what the user does to it, so I just need to know how to calculate the center point of a face regardless if it’s on a cube or not.

Figured it out. Just average the positions of the distinct vertices in the face and you get the local position.