How to calculate the antipodes of a GPS coordinate? Suppose I have a GPS location with Lattitude of 12 and Longitude of 15.
Is it possible to calculate the Lat. and Lon. of the opposite side of the earth from just those two numbers? And how?
 A: This is described most easily if we use a convention for signed latitudes and longitudes,
such as "north and east are positive, south and west are negative."
Using signed coordinates, simply reverse the sign of the latitude (multiply by $-1$), and either add or subtract $180$ degrees from the longitude.
Basically, what this does is to travel $180$ degrees around the great circle that
coincides with your starting line of longitude. As you travel around that great circle,
within less than $180$ degrees you will cross over a pole and find yourself
on the line of longitude 180 degrees away from the one where you started.
You'll end up as far below the equator as the distance you started above it.
I prefer a two-line formula for this, with "if" cases.
If you let latitude and longitude be represented (in that order) by a
pair of numbers, that is, $(\theta,\phi)$ means latitude $\theta$ and longitude $\phi$,
then you can write
$$\mathop{Antipodes}(\theta,\phi)
 = \begin{cases}(-\theta,\phi - 180^\circ) & \mbox{if}\quad \phi > 0,\\
(-\theta,\phi + 180^\circ) & \mbox{if}\quad \phi \leq 0.
\end{cases}$$
For example, $$\mathop{Antipodes}(12^\circ, 15^\circ) = (-12^\circ, -165^\circ),$$
that is, the antipodes of $12$ N latitude $15$ E longitude is
$12$ S latitude $165$ W longitude, because $15 > 0$.
But $$\mathop{Antipodes}(-40^\circ, -80^\circ) = (40^\circ, 100^\circ),$$
so if you start at $40$ S latitude $80$ W longitude the antipodes is
$40$ N latitude $100$ E longitude, because $-80 < 0$.
If you really want a formula all on one line, 
and you are willing to use a "remainder" function
(such as the MOD function implemented in Excel or OpenOffice), you can write
$$\mathop{Antipodes}(\theta,\phi) = (-\theta,(\mathrm{MOD}(\phi, 360) - 180)^\circ),$$
because $\mathrm{MOD}(\phi, 360) = \phi$ when  $0^\circ \leq \phi \leq 180^\circ$
and $\mathrm{MOD}(\phi, 360) = \phi + 360$ when $-180^\circ \leq \phi < 0^\circ$.
Using the convention that longitude is a signed number, 
the function for the longitude of the antipodes is discontinuous if you want the
result to look like the way people normally write longitude: numbers slightly larger
than zero go to numbers near $-180$ and numbers slightly smaller than zero go to 
numbers near $180$.
Another alternative, if you make the directions N,S,E,W part of your notation,
is to write
$$\mathop{Antipodes}\left(\theta\ \mathop{}^{\mathrm N}_{\mathrm S},
                     \phi\ \mathop{}^{\mathrm E}_{\mathrm W}\right)
 = \left(\theta\ \mathop{}^{\mathrm S}_{\mathrm N},
 (180^\circ - \phi)\ \mathop{}^{\mathrm W}_{\mathrm E}\right)$$
where the symbols $\mathop{}^{\mathrm N}_{\mathrm S}$, 
$\mathop{}^{\mathrm S}_{\mathrm N}$, etc. indicate that you reverse the direction
of each coordinate, that is, N becomes S, E becomes W, and so forth.
A: Using @David Ks answer, I created simple JavaScript functions that convert integer latitude and longitudes to antipodal latitudes and longitudes:
function getAntipodeLat(lat) {
  return lat * -1;
}

function getAntipodeLng(lng) {
  return lng > 0 ? lng - 180 : lng + 180;
}

