Cody

Solution 558659

Submitted on 16 Jan 2015 by goc3
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
for tests=1:5 xc_truth=randn; yc_truth=randn; r_truth=rand; rand_ang=randi(360,3,1)+rand(3,1); % Avoid duplicate location via rand(3,1) pts=[xc_truth+r_truth*cosd(rand_ang) yc_truth+r_truth*sind(rand_ang)]; [xc,yc,r]=find_circle(pts); %dif=[xc yc r]-[xc_truth yc_truth r_truth] assert(max(abs([xc,yc,r]-[xc_truth,yc_truth,r_truth]))<1e-6,... sprintf('Expect xc %.2f yc %.2f r %.2f Ans:%.2f %.2f %.2f',... xc_truth,yc_truth,r_truth,xc,yc,r)) end

xc = -1.9384 yc = -0.8404 r = 0.4625 xc = -0.5867 yc = 0.4053 r = 0.2154 xc = 2.8647 yc = -1.8475 r = 0.6337 xc = 1.9117 yc = -0.0610 r = 0.0986 xc = 1.4661 yc = 0.9813 r = 0.5514