tag:blogger.com,1999:blog-55852283626531979832014-10-02T23:55:29.609-07:00Calculate Ellipse CircumferenceThoughtful Livinghttp://www.blogger.com/profile/02962470194573380376noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5585228362653197983.post-10656213270974123472011-12-17T18:52:00.000-08:002012-12-30T09:54:54.720-08:00Accurate Online Ellipse Circumference Calculator<script LANGUAGE="JavaScript">function ec(form) { X1=eval(form.A.value) X2=eval(form.B.value) MIN=Math.min(X1,X2); MAX=Math.max(X1,X2); RA=MAX/MIN; RA=RA.toPrecision(6); RB=MIN/MAX; RB=RB.toPrecision(6); HT1 = X2-X1; HB1 = X2+X1; H1 = (Math.pow(HT1,2))/(Math.pow(HB1,2)); H2 = 4-3*H1; D1 = ((11*Math.PI/(44-14*Math.PI))+24100)-24100*H1; C1 = Math.PI*HB1*(1+(3*H1)/(10+Math.pow(H2,0.5))+(1.5*Math.pow(H1,6)-.5*Math.pow(H1,12))/D1); P = 6; C1 = C1.toPrecision(P); form.C.value = C1; form.RX.value = RA; form.RN.value = RB} </SCRIPT><br /><form><table border="1" cellpadding="1" cellspacing="1" width=”100%”><tr align="center"><td>Ellipse Axis Half-Length 1</td><td><input type="number" name="A" value=""></td></tr><tr align="center"><td>Ellipse Axis Half-Length 2</td><td><input type="number" name="B" value=""></td></tr><tr align="center"><td>Aspect Ratio (>=1 convention)</td><td><input type "number" value="" name="RX" readonly></td></tr><tr align="center"><td>Aspect Ratio (<=1 convention)</td><td><input type "number" value="" name="RN" readonly></td></tr><tr align="center"><td>Circumference</td><td><input type "number" value="" name="C" readonly></td></tr><tr align="center"><td><input type="button" value="Click Here To Calculate" onClick="ec(this.form)"></td><td><input type="reset"></td></tr></table></form><br> <br>**** **** **** **** **** **** **** **** **** **** **** <br>Update: 12/25/2012 (I have time on Christmas day to do more investigation on this since Ben Bernanke (BernankGrinch) of the Federal Reserve stole yet another Christmas from me in him manipulating the pig stock market up making valuations 2X too high relative to PE ratios exhibited in bad economies of the past (reporters keep the public in the dark about this), preventing me from earning bank interest and forces inflation on me - please join with me in pushing Congress to oust him at once and END the FED once and for all!)<br><BR>** ** ** ** ** Merry Christmas to all those who got my money and the money of others through the swindling of BernankGrinch, stealing the money from the pot of all Americans and giving it out to the few who he thinks need it more-the wealthy who go long a 2X overpriced manipulated stock market...amazing isn't it??? ** ** ** ** **<br><BR>An added improvement has been made that enables greater accuracy and a slightly simpler formula (in my opinion). The portion of the equation on the far right side that formerly had h^5.20114 is now replaced with what I think is simpler to memorize: <font color="red">1.5*h^6-0.5*h^12</font> and the factor in the denominator that was formerly 19176 is now replaced with <font color="red">24100</font>. This provides a maximum absolute relative error of just over 805 ppb - a sizable improvement over the former 1.4ppm! In fact, if wanting a slightly better improvement, you can use 24113 to obtain just over 790ppb relative error. I recommend using the 24100 to be consistent with simplicity. Even though this can be further optimized as shown below, the numbers here are easier to memorize. If having the exact value for the degenerate ellipse is not of great importance, you may substitute the messy <font color="red">(11pi/(44-14pi)) with the integer 1952</font> to make memorizing even easier. <br><BR>Additionally, for an even better maximum absolute relative error of just under 670 ppb, the power portion could be replaced with 1.75*h^6-0.75*h^14 and the lower integer factor to go along with this would be 30650. Of course just like the above case, 30646 would better optimize the form yet makes for added difficulty for memorizing. If the relative error was under 500ppb, I would change the formula for the form to permit an added significant digit. **** **** **** **** **** **** **** **** **** **** **** <br><a href="http://i39.photobucket.com/albums/e191/toomers/blankenhornramanujan12252012_zps48db6b9d.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 520px; height: 150px;" src="http://i39.photobucket.com/albums/e191/toomers/blankenhornramanujan12252012_zps48db6b9d.jpg" border="0" alt="" /></a></p></br><br clear=all>Where a and b are the half length axes and h = (a-b)^2/(a+b)^2<br /><br /><br />This is among the most accurate simple solitary formulas for the circumference of an ellipse over the range from the degenerate collapsed ellipse to circle with exact endpoints. The maximum relative error is about 805ppb, permitting 5 significant digits. This has an absolute relative error nearly 20 times lower than the Cantrell-Ramanujan approximation. I suppose I could call this the Blankenhorn-Ramanujan approximation.<br /><br />If you encounter sites that give approximations based on C ~ pi*SQRT(2(a^2+b^2)) or similar faulty formulas you will be given highly inaccurate results. Even sites that make use of theoretical polynomial expansions will often give inaccurate results at high eccentricities. <br /><br /><br />Graph of Error Function (Approximate):<br /><center><a href="http://i39.photobucket.com/albums/e191/blankenhornramanujanerror2_zpsd73983df.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 500px; height: 320px;" src="http://i39.photobucket.com/albums/e191/toomers/blankenhornramanujanerror2_zpsd73983df.jpg" border="0" alt="" /></a></p></center><br /></br><br clear=all><br /><br />For a more accurate ellipse circumference calculator, and without the use of the Hoelder mean, click below:<br /><br /><h1 style="background: #00FFFF; color: #fff; line-height: 1em; border: 1px solid #f0f;"><a href="http://ellipse-circumference2.blogspot.com">Accurate Ellipse Circumference Calculator</a><br /></h1><br />For a highly accurate ellipse circumference calculator permitting 8 significant digits, and without the use of π, click below:<br /><br /><h1 style="background: #00FFFF; color: #fff; line-height: 1em; border: 1px solid #f0f;"><a href="http://ellipse-circumference3.blogspot.com">Highly Accurate Ellipse Circumference Calculator</a></h1><br /><br /><br />Copyright: December 31, 2011 by Thomas Blankenhorn<br /><br /><br /><br />Further investigation of ellipse circumference formulas:<br /><br /><a href="http://www.numericana.com/answer/ellipse.htm">Ellipse Circumference Formulas</a><br /><br /><a href="http://www.ebyte.it/library/docs/math07/EllipsePerimeterApprox07.html">Advances in Ellipse Perimeter Approximations</a> <br /><br /><a href="http://mathforum.org/kb/thread.jspa?threadID=2327068&messageID=7633517#7633517">Modifications of Ramanujan's Ellipse Circumference Formula</a> Thoughtful Livinghttp://www.blogger.com/profile/02962470194573380376noreply@blogger.com0