# Refactoring the ellipsoid calculator

Circles and spheres are easy to measure. Calculating a spherical dome’s floor area, surface area, perimeter, and volume are straightforward mathematical formulas. When I wrote the new Spherical Dome Calculator, the challenge was the scaled drawing, not the computed values. Ellipsoids — on the other hand — are hard.

Mathematicians have written a pile of papers on ellipse and ellipsoid math. There are multiple methods to calculate an approximate perimeter of an ellipse — a surprisingly hard challenge. To make matters worse, there are rarely any perfect spheres or circles in the real world. The earth is not a sphere. It’s an oblate ellipsoid. All the planets orbit around the sun in elliptical orbits. That’s part of the reason why NASA needs supercomputers.

Buckminster Fuller used to say, “I don’t think nature uses π. I think she has some other mathematical way of coordinating her undertakings.”

And so it is with our Ellipsoid Dome Calculator. We cannot hope to replicate nature’s perfection. All we can do is try to approximate it. The trick is to divide the shape into tiny slices and add up the slices individually. I’ve written programs to do similar work before. The original oblate ellipsoid calculator divided the dome into 500 slices — Javascript on web browsers in the early 2000s wasn’t particularly fast. It did a reasonable job of calculating the surface distance and surface area. Admittedly, the code was a mess. Now I have an opportunity to revisit the problem.

The new calculator implements a complete “vertical” ellipsoid object for a dome with a circular base and an elliptical crosssection. Instead of 500 slices to calculate surface distance and surface area, we use 36,000 slices. The results are still just an approximation, but a dang good one. I figure we went from four or five significant digits to eight or nine. That’s way more than enough for a Monolithic Dome. It took three rewrites of this little program to get it right.

The Ellipsoid Dome Calculator is a special version of a vertical ellipsoid. The diameter and height are also the horizontal and vertical measurements of the ellipsoid shape. We made it this way because most of our ellipsoid calculators are for half-ellipsoid domes on a small stem-wall — typically used for house-sized domes. The oblate shape gives more standing room around the perimeter while lowering the overall height, which lowers the overall surface area and saves money on construction.

The next calculator will be a complete Vertical Ellipsoid Dome Calculator where we describe an ellipsoid that is cut off above or below the equator.