Cody

# Problem 47043. Find the Arc Length of the Curve Defined by the Parametric Functions

Solution 3340208

Submitted on 23 Oct 2020 by Tim
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
interval=[0,2*pi]; a=3; b=1; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 16; assert(abs(arcLength(x,y,interval)-S)<1e-3)

2   Pass
interval=[0,2*pi]; a=5; b=1; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 32; assert(abs(arcLength(x,y,interval)-S)<1e-3)

3   Pass
interval=[0,2*pi]; a=7; b=1; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 48; assert(abs(arcLength(x,y,interval)-S)<1e-3)

4   Pass
interval=[0,6*pi]; a=7; b=3; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 96; assert(abs(arcLength(x,y,interval)-S)<1e-3)

5   Pass
interval=[0,10*pi]; a=11; b=5; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 240; assert(abs(arcLength(x,y,interval)-S)<1e-3)

6   Pass
interval=[0,2*pi]; x=@(t)5*(t-sin(t)); y=@(t)5*(1-cos(t)); S=40; assert(abs(arcLength(x,y,interval)-S)<1e-3)

7   Pass
interval=[0,100*pi]; a=pi; b=1; x = @(t)(a-b)*cos(t)+b*cos((a-b)/b*t); y = @(t)(a-b)*sin(t)-b*sin((a-b)/b*t); S = 856.288; assert(abs(arcLength(x,y,interval)-S)<1e-3)

### Community Treasure Hunt

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

Start Hunting!