Cody

# Problem 636. Spherical radius given four points

Solution 1965635

Submitted on 7 Oct 2019
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   Fail
pts=[0 3 2;1 -1 1;2 1 0;5 1 3]; % c(2 1 3) r=3 y_correct = 3; assert(isequal(Sphere_radius(pts),y_correct))

mag = 3.6056 mag = 1.7321 mag = 2.2361 mag = 5.9161

Output argument "r" (and maybe others) not assigned during call to "Sphere_radius". Error in Test1 (line 3) assert(isequal(Sphere_radius(pts),y_correct))

2   Fail
pts=[1 0 0;0 1 0;0 0 1;-1 0 0]; % c(0 0 0) r=1 y_correct = 1; assert(isequal(Sphere_radius(pts),y_correct))

mag = 1 mag = 1 mag = 1 mag = 1

Output argument "r" (and maybe others) not assigned during call to "Sphere_radius". Error in Test2 (line 3) assert(isequal(Sphere_radius(pts),y_correct))

3   Fail
pts=[1 0 -1;0 1 -1;0 0 0;-1 0 -1]; % c(0 0 -1) r=1 y_correct = 1; assert(isequal(Sphere_radius(pts),y_correct))

mag = 1.4142 mag = 1.4142 mag = 0 mag = 1.4142

Output argument "r" (and maybe others) not assigned during call to "Sphere_radius". Error in Test3 (line 3) assert(isequal(Sphere_radius(pts),y_correct))

4   Fail
pts=[2 0 -2;0 2 -2;0 0 0;-2 0 -2]; % c(0 0 -2) r=2 y_correct = 2; assert(isequal(Sphere_radius(pts),y_correct))

mag = 2.8284 mag = 2.8284 mag = 0 mag = 2.8284

Output argument "r" (and maybe others) not assigned during call to "Sphere_radius". Error in Test4 (line 3) assert(isequal(Sphere_radius(pts),y_correct))

5   Fail
pts=[-5 -1 -3;1 -1 -3;-2 -4 -3;-2 -1 0]; % c(-2 -1 -3) r=3 y_correct = 3; assert(isequal(Sphere_radius(pts),y_correct))

mag = 5.9161 mag = 3.3166 mag = 5.3852 mag = 2.2361

Output argument "r" (and maybe others) not assigned during call to "Sphere_radius". Error in Test5 (line 3) assert(isequal(Sphere_radius(pts),y_correct))