Dig to Australia - antipodes Background

Countless generations of children have wondered where they would end up if they dug a hole directly downwards. It turns out that this would, unsurprisingly, be rather dangerous, but anyway...

Antipodes are points that are directly opposite each other on the Earth's surface. This means that if a line was drawn between the two points, it would pass through the centre of the Earth.

Challenge

Write a program or function that, given a point, finds its antipode.

In this challenge, points are represented using the longitude-latitude system and degrees, arc minutes and arc seconds. To find the antipode, swap the directions of each ordinate (N &lt;-&gt; S and W &lt;-&gt; E) and subtract the longitude ordinate from 180 degrees.

Example:
Take the point N 50 26 23 W 4 18 29. Swap the directions to give S 50 26 23 E 4 18 29. Subtract the longitude ordinate from 180 0 0 to give 175 41 31, leaving the antipode coordinates as S 50 26 23 E 175 41 31.

Rules

Input

A set of latitude-longitude coordinates, in any reasonable format, where each ordinate contains a direction, a number of degrees, a number of arc minutes, and a number of arc seconds.

Output

The latitude-longitude coordinates of the antipode, in any reasonable format, where each ordinate contains a direction, a number of degrees, a number of arc minutes, and a number of arc seconds.

Take reasonable to mean that each part of the coordinate can be distinguished unambiguously.

Specs


The direction for the latitude ordinate is N or S, and that for the longitude ordinate is W or E.
All coordinate values are integers. The degree value will be between 0 and 90 for latitude, and between 0 and 180 for longitude. The arc minute and arc second values for both ordinates will be between 0 and 59.
If all the values for an ordinate are 0, either direction is acceptable.
There is no need to zero-pad any values.
No latitude ordinate will ever  be larger than 90 degrees, and no longitude ordinate will ever be larger than 180 degrees.
Standard loopholes apply. 


Test cases

N 50 26 23 W 4 18 29 -&gt; S 50 26 23 E 175 41 31

S 43 9 9 E 0 0 5     -&gt; N 43 9 9 W 179 59 55

N 0 0 0 E 0 0 0      -&gt; S/N 0 0 0 W/E 180 0 0 (either direction fine in each case)

S 1 2 3 W 4 5 6      -&gt; N 1 2 3 E 175 54 54

S 9 21 43 W 150 7 59 -&gt; N 9 21 43 E 29 52 1

S 27 40 2 W 23 0 0   -&gt; N 27 40 2 E 157 0 0

N 0 58 37 W 37 0 0   -&gt; S 0 58 37 E 143 0 0


Useful links


Latitude and longitude
Antipodes
Arc minutes and arc seconds


This is code-golf, so the shortest answer in bytes wins!
MATL, 51 bytes
'NS'tPXEii'WE'tPXE648e3i60:qXJZA-JYAtn3-?2:&amp;)wJZAwh

Input format:
'N'
[50 26 23]
'W'
[4 18 29]

Output format:
S
50 26 23
E
175  41  31

Try it online!
Explanation
'NS'tPXE     % Take input (string) implicitly. Exchange 'N' and 'S'
i            % Take input (array)
i'WE'tPXE    % Take input (string). Exchange 'W' and 'E'
648e3        % Push 648000
i            % Take input (array)
60:qXJ       % Push [0 1 ... 59]. Copy into clipboard J
ZA           % Convert second input array from base 60 to decimal
-            % Subtract
JYA          % Convert to base 60
tn3-?        % If length exceeds 3
  2:&amp;)       %   Split into first two elements and then the rest
  w          %   Swap
  JZA        %   Convert from base 60 to decimal
  wh         %   Swap, concatenate