Cody

# Problem 45979. Compute the perimeter of an ellipse

Solution 2598550

Submitted on 22 Jun 2020 by Tim
• Size: 34
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = 3; b = 4; P_correct = 22.103492160709504; assert(abs(ellipsePerim(a,b)-P_correct)/P_correct<1e-8)

2   Pass
a = 4; b = 3; P_correct = 22.103492160709504; assert(abs(ellipsePerim(a,b)-P_correct)/P_correct<1e-8)

3   Pass
a = 1; b = 8; P_correct = 32.744956600195508; assert(abs(ellipsePerim(a,b)-P_correct)/P_correct<1e-8)

4   Pass
a = 1; b = 0.974062207869516; P_correct = 6.201967; assert(abs(ellipsePerim(a,b)-P_correct)/P_correct<1e-8)

5   Pass
a = 4*rand(1); b = a; P_correct = 2*pi*a; assert(abs(ellipsePerim(a,b)-P_correct)/P_correct<1e-8)

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!