Cody

Solution 1793940

Submitted on 20 Apr 2019 by Ian Southgate
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
%Mathworks headquarters lat = '42.3 N'; long = '71.37 W'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct = '42.3 S'; long_o_correct = '108.63 E'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '42.3 S' h = 108.6300 i = '71.37 E' long_o = '108.63 E'

2   Pass
%San Antonio lat = '29.31 N'; long = '98.46 W'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct = '29.31 S'; long_o_correct= '81.54 E'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '29.31 S' h = 81.5400 i = '98.46 E' long_o = '81.54 E'

3   Pass
%My city lat = '32.9 S'; long = '68.82 W'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct= '32.9 N'; long_o_correct = '111.18 E'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '32.9 S' lat_o = '32.9 N' h = 111.1800 i = '68.82 E' long_o = '111.18 E'

4   Pass
%Big Ben lat = '51.5 N'; long = '0.12 W'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct= '51.5 S'; long_o_correct = '179.88 E'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '51.5 S' h = 179.8800 i = '0.12 E' long_o = '179.88 E'

5   Pass
%Wellington lat = '41.27 S'; long = '174.78 E'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct= '41.27 N'; long_o_correct = '5.22 W'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '41.27 S' lat_o = '41.27 N' h = 5.2200 i = '174.78 E' i = '174.78 W' long_o = '5.22 W'

6   Pass
%Some point of Brasil lat = '1 S'; long = '50 W'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct= '1 N'; long_o_correct = '130 E'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '1 S' lat_o = '1 N' h = 130 i = '50 E' long_o = '130 E'

7   Pass
% Some point near to Moscú lat = '55 N'; long = '37 E'; [lat_o long_o]=opposite_earth_point(lat,long); lat_o_correct= '55 S'; long_o_correct = '143 W'; assert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))

lat_o = '55 S' h = 143 i = '37 E' i = '37 W' long_o = '143 W'