3 ms·
There is a simple calculus solution that is more elegant that the primary school maths solution... That is to use Green's Theorem. https://en.wikipedia.org/wi
by dnautics 11y ago
There is a simple calculus solution that is more elegant that the primary school maths solution... That is to use Green's Theorem.
https://en.wikipedia.org/wiki/Green%27s_theorem#Area_Calculation https://en.wikipedia.org/wiki/Green%27s_theorem#Area_Calcula...
In fact, the algorithm for the area of the interior polygon that you are using itself (shoelace algorithm) uses green's theorem 'in stealth mode'.