Post Reply 
Ellipsoid surface area
05-28-2021, 08:05 PM
Post: #2
RE: Ellipsoid surface area
Sorting the semi-axis may not be necessary.
This version removes semi-axis sorting step.
Also, test for perfect sphere is also eliminated.

Technically, with ellipsoid symmetry, input can be in any order.
However, we wanted to avoid catastrophic cancellation of terms.

As long as user input is in sorted order (or reverse sorted), it will give good result.
In other words, I am basing length relative to b.

Code:
#cas
ellipsoid_area(a,b,c)
BEGIN
    local t1, t2, x;
    t1 := 1.-(b/a)^2;
    t2 := 1.-(b/c)^2;
    t2 := int((1-t1*t2*x*x)/sqrt((1-t1*x*x)*(1-t2*x*x)), x, 0., 1);
    return 2.*pi*(b*b+t2*a*c);
END
#end

Note the t1, t2 symmetry. Swapping (a,c) returns same result.

CAS> ellipsoid_area(1,1,1)       → 12.5663706144 (4*pi)
CAS> ellipsoid_area(1,2,3)       → 48.8821463026
CAS> ellipsoid_area(1,3,2)       → 48.8821463026
CAS> ellipsoid_area(3,1,2)       → 48.8821463026

I confirmed numbers with keisan Online Calculator
For a,b,c = 3,2,1: S = 48.8821463025820596957
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Ellipsoid surface area - Albert Chan - 05-28-2021, 12:37 AM
RE: Ellipsoid surface area - Albert Chan - 05-28-2021 08:05 PM
RE: Ellipsoid surface area - Albert Chan - 05-30-2021, 06:04 PM
RE: Ellipsoid surface area - Albert Chan - 05-31-2021, 01:38 AM
RE: Ellipsoid surface area - Albert Chan - 08-05-2022, 04:40 PM
RE: Ellipsoid surface area - Albert Chan - 08-05-2022, 04:51 PM



User(s) browsing this thread: 1 Guest(s)