Author: Hannah Nelson Date: June 29th, 2023
This repository contains the function fluxCenter! fluxCenter Computes the center of mass of an irregular polygon using its vertecies!
To make use of this algorithm create a list of 2d vectors contained in Vector2D.py . Call the function fluxCenter from fluxCenter.py with this list as a parameter! This function call will return the center of mass of the polygon specified by the vectors! The vectors are interpreted as positions of the verticies of the polygon!
fluxCenter uses the divergence theorem to perform the integrations needed to find the center of mass! By measuring the flux of a fields across a set of line segments enclosing a space, flux obtains the total divergence in that space! The fields are chosen such that the divergences are 1, x, and y respectively. Therefore the total flux are are:
Using these we can easily obtain the center of mass!
The respective formulas for flux across each line segment are:
These formulas were derived from a line integral!
Where in each