Perimeter of Ellipse +- HP Forums (http://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Perimeter of Ellipse (/thread-5820.html) |
Perimeter of Ellipse - Joe Horn - 03-05-2016 11:19 AM Although simple formulae for the perimeter of an ellipse exist, they are only approximations. Exact formulae are complicated. The following program uses a converging iteration technique instead. Ported from a QBASIC program by Gérard P. Michon. Syntax: EllipsePerimeter(a,b), where a & b are the lengths of the axes (order doesn't matter) Output: perimeter of ellipse Examples: EllipsePerimeter(0.5, 0.5) --> 3.14159265359 EllipsePerimeter(3, 4) --> 22.1034921607 Code: gk(h); RE: Perimeter of Ellipse - Wes Loewer - 03-06-2016 06:55 AM I was going to suggest the following: Code: EXPORT EllipsePerimeter(a,b) but it seems that PPL doesn't like local variables inside of an integral. Here's a work-around: Code: EXPORT EllipsePerimeter(a,b) or this work-around: Code: EXPORT EllipsePerimeter(a,b) |