I am by no means a math buff but I am trying to implement a reasonable accurate formula for calculating the perimeter of an ellipse for a program I am writing.
I found a web page that offers a few formulae and I am interested in this one:
I have no idea how a "binomial coefficient" works, I am only interested in how I can determine the denominator for n number of terms. Ex:
Here there are 3 "terms", how did the writer of the article determine that 4, 64 and 256 are appropriate denominators?
I noticed that 4 = 1 *4, 64 = 4 * 4 * 4, 256 = 4 * 4 * 4 * 4 and so forth.
My code so far:
for(let i = 1; i <= iterations; i++)
if(i == 1)
rh += (1/4) * h;
else
rh += (1/(Math.pow(4, i+1)))*Math.pow(h, i);
I would like to avoid the if-else statement if possible.

