This solution is outdated. To rescore this solution, sign in.
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)
|
206 Solvers
Getting the indices from a matrice
360 Solvers
Detect a number and replace with two NaN's
178 Solvers
405 Solvers
poll: would you like the regexp (?@cmd) functionality to be banned in Cody?
169 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!