Cody

Solution 2141304

Submitted on 26 Feb 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
x1=[0,0]; x2=[5,5]; r1=3; r2=2; assert(isequal(touch(x1,x2,r1,r2),0))

a = 7.0711 s1 = 5 s2 = 1

2   Pass
x1=[0,0]; x2=[3,4]; r1=3; r2=2; assert(isequal(touch(x1,x2,r1,r2),1))

a = 5 s1 = 5 s2 = 1

3   Pass
x1=[2,1]; x2=[3,4]; r1=4; r2=2; assert(isequal(touch(x1,x2,r1,r2),0))

a = 3.1623 s1 = 6 s2 = 2

4   Pass
x1=[-1,0]; x2=[3,-3]; r1=3; r2=8; assert(isequal(touch(x1,x2,r1,r2),1))

a = 5 s1 = 11 s2 = 5

5   Pass
x1=[-5,-5]; x2=[5,5]; r1=5; r2=5; assert(isequal(touch(x1,x2,r1,r2),0))

a = 14.1421 s1 = 10 s2 = 0

Suggested Problems

More from this Author124