Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 19441

Submitted on 31 Jan 2012 by Tomasz

Correct

38Size
Leading solution size is 26.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
assert(isequal(round(sphere_distance(100,10,50,-20,14)*10000)/10000,75.9097));

                    
2
Pass
 
%%
assert(isequal(round(sphere_distance(6371e3,-97.7430608,30.267153,-74.0244265,40.6081588)*10000)/10000,2426004.8394));

                    
3
Pass
 
%%
assert(isequal(round(sphere_distance(6371e3,-97.7430608,31.267153,-74.0244265,40.6081588)*10000)/10000,2364307.7819));