8 ms·
This is one of those when you go "Huh, this is amazing!" or "Huh, I thought this trick was really well known!" depending on your background ;) Here's a similar
by physicsguy 19d ago
This is one of those when you go "Huh, this is amazing!" or "Huh, I thought this trick was really well known!" depending on your background ;)
Here's a similar impl from 1980 written in Fortran that also computes other properties like centroid:
https://calgo.acm.org/550.zip https://calgo.acm.org/550.zip
Algorithm 550: Solid Polyhedron Measures
A. M. Messner and G. Q. Taylor
ACM Trans. Math. Softw., 6(1), Mar 1980, pp.121--130
Keywords: polyhedron, graphics, numerical integration
Language: Fortran 66/77; Shar Index: Z; Gams: P
File size: 19.1 KB;
But Messner published it first in:
A. M. Messner, "A surface Integral method for computer
calculation of mass properties", Paper No. 852, 29TH ANNUAL
CONF. OF THE SOCIETY OF AERONAUTICAL WEIGHT ENGINEERS,
Washington, D.C., May 1970.
I think
- jacobolus 19d agoThis is one variant of the 3-d analog of the "shoelace formula" for area: https://en.wikipedia.org/wiki/Shoelace_formula#Generalization https://en.wikipedia.org/wiki/Shoelace_formula#Generalizatio... The 2-d version is from the 18th century. I'd expect the 3-d version was probably known in the 19th century, but I haven't searched for a reference.
- amluto 19d agoThis technique should be straightforwardly adaptable to compute arbitrary moments, not just the centroid. If you have a scalar-valued function that you can conveniently express as the divergence of any closed-form function, you can integrate it like this. And you can generalize beyond scalar-valued functions and beyond Euclidean space using the generalized Stokes’ theorem. You can even do this in real life: if you want to integrate the electric current density through a surface (that is, measure the total current crossing the surface), you can integrate its anti-curl (is that a word?) around the boundary of that surface, which is what a current transformer or a clamp-on current meter does. I bet there’s a hydraulic or pneumatic analog as well, but a nontrivial example isn’t immediately coming to mind.
- ted_dunning 19d agoThe hydraulic analog is that you can weigh a volume of water (which is the same as computing its volume) by adding up the forces on the surface surrounding the water. This looks like it requires a dot product with the normal vector for each triangle, but you can expand it into the same form as the article.
- georgeburdell 19d agoAs an aside, this seems related to the Holographic Principle? It states that the content of a volume is encoded in its surface https://en.wikipedia.org/wiki/Holographic_principle https://en.wikipedia.org/wiki/Holographic_principle