Cody

# Problem 264. Find the "ordinary" or Euclidean distance between A and Z

Solution 132804

Submitted on 30 Aug 2012 by Hardajit
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
%% A = [1,0,0]; B = [5,3,0]; Z=[5,3,3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 1 0 0 B = 5 3 0 Z = 5 3 3 y = 1 0 0 5 3 0 5 3 3

2   Pass
%% A = [1;0;0]; B = [5;3;0]; Z=[5;3;3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 1 0 0 B = 5 3 0 Z = 5 3 3 y = 1 0 0 5 3 0 5 3 3

3   Pass
%% A = [0,0,0]; B = [4,3,0]; Z=[4,3,3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 0 0 0 B = 4 3 0 Z = 4 3 3 y = 0 0 0 4 3 0 4 3 3

4   Pass
%% A = [0;0;0]; B = [4;3;0]; Z=[4;3;3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 0 0 0 B = 4 3 0 Z = 4 3 3 y = 0 0 0 4 3 0 4 3 3

5   Pass
%% A = [0,3,0]; B = [4,0,0]; Z=[4,0,3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 0 3 0 B = 4 0 0 Z = 4 0 3 y = 0 3 0 4 0 0 4 0 3

6   Pass
%% A = [0;3;0]; B = [4;0;0]; Z=[4;0;3]; y_correct = 5.830951894845301; assert(isequal(euclidean(A,B,Z),y_correct))

A = 0 3 0 B = 4 0 0 Z = 4 0 3 y = 0 3 0 4 0 0 4 0 3

7   Pass
%% A = [0;3;0]; B = [4;0;0]; Z=[4;0;12]; y_correct = 13; assert(isequal(euclidean(A,B,Z),y_correct))

A = 0 3 0 B = 4 0 0 Z = 4 0 12 y = 0 3 0 4 0 0 4 0 12