Cody

# Problem 45979. Compute the perimeter of an ellipse

Solution 2650241

Submitted on 3 Jul 2020 by Asif Newaz
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)

P = 22.1035

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

P = 22.1035

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

P = 32.7448

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

P = 6.2020

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

P = 7.0651

### Community Treasure Hunt

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

Start Hunting!