# Bearing due, due and back

[A variation of : What color was the bear?$/$Where is your rescue partner?]

From which latitudes on a theoretically spherical Earth can you proceed as follows?
•  Set out by traveling due south for 90° of latitude (¼ of Earth's circumference)
•  Then go due west for the same distance (at least 90° of longitude)
•  Complete a round trip by maintaining a northeast bearing for √ 2  times that distance
•  (Again be where you began, as would be the case anywhere and for all distances on a flat Earth, where the complete path would be a proper isosceles right triangle with a straight northeasterly hypotenuse)

Notes:
•  The northeasterly segment follows a 45° rhumb line — not a “straight” line or great circle — because northeast is re-reckoned at each point along the path
•  No need to precisely calculate answers as long as they are otherwise complete and convincing
•  This is an unvarnished geometry puzzle without regard to the inaccuracy of a compass, the irregularity or geography of Earth, the limitations of real travel, or the real risks of real-life constant-bearing adventure
•  Indeed, any resemblance to an existing Earth by the so-called Earth here, or by the terminology of latitudes, longitudes, rhumb lines and compass directions, is purely for the sake of familiarity; no actual axial antipodes were harmed (thank you, @question_asker)

• OK, at the risk of being That Guy: I feel like you're missing a condition here. As it reads, it seems like you're asking where on a sphere you can draw a right triangle—is the condition that the entire trip be made on land only? If this is the case, it seems like it might be interesting to ask how many such trips can be made regardless of the triangle's orientation. – question_asker Feb 8 '16 at 13:31
• Must the starting point be in the Northern hemisphere? If starting points in the Southern hemisphere are allowed, how do we define travelling northeast from the South Pole? – hexomino Feb 8 '16 at 16:02
• @human Reading hexomino's answer, I was able to figure out what the distinction was. Am I right in assuming you're only using "Earth" because it familiarly uses latitude and longitude lines (where, say, a regular old sphere wouldn't)? – question_asker Feb 8 '16 at 19:35
• @human I don't think it necessarily does contradict that claim - you could substitute a sphere with arbitrary antipodal poles and essentially do the same math and achieve the same answer (but with, say, distance along a great circle from one of the poles instead of a latitude). Then again, at that point, might as well use a globe. Excuse my terminology, I know approximately jack about math. – question_asker Feb 8 '16 at 19:45
• Well appreciated, @question_asker, your clarifying comments will be incorporated into the puzzle in the next round of edits. In the meanwhile, by considering $@$hexomino's answer's (puzzling.stackexchange.com/a/26238/18129) observation about $\surd2$ and by enjoying the "pole-to-pole loxodrome" pictures at rhumb line, ~jack of math is enough to describe some fancy solutions. – humn Feb 8 '16 at 20:21

I'll assume that the Earth is a sphere of radius 1 and that the starting point is in the Northern hemisphere.

In the accompanying Wikipedia article about the rhumb line, it tells us that "The distance between two points, measured along a [rhumb line], is simply the absolute value of the secant of the bearing (azimuth) times the north-south distance". Hence, if our bearing returns us to the starting point, it will have the correct distance as specified in the question (since $\sec(\pi/4) = \sqrt{2}$). So, it suffices to find the latitudes for which the north-easterly journey returns us to the beginning. Now, if we travel south from a latitude of $\phi_1$ to a distance $\pi/2$ and then West for the same distance, the azimuthal angle we go through is $\frac{\pi}{2\sin(\phi_1)}$.

Another part of the Wikipedia article gives us that

The differential relationship between the azimuthal angle $\lambda$ and the polar angle $\phi$ as we travel along the rhumb line is $\frac{d\lambda}{d\phi} = \sec \phi$. Integrating both sides with respect to $\phi$ tells us that travelling along the rhumb from polar angle $\phi_0$ to $\phi_1$ corresponds to travelling an azimuth of angle $\log(\tan(\phi_1) + \sec(\phi_1)) - \log(\tan(\phi_0) + \sec(\phi_0))$. Now, as per the question, we want $\phi_0 = \phi_1 - \pi/2$, hence the azimuth difference in the last leg of the journey is $\log(\frac{\tan(\phi_1) + \sec(\phi_1)}{-\cot(\phi_1) + \csc(\phi_1)})$ which must be equal to the azimuthal angle $\frac{\pi}{2\sin(\phi_1)}$ we derived from travelling south then west.

So any latitude which works is the solution $x$ to

$\log(\frac{\tan(x) + \sec(x)}{-\cot(x) + \csc(x)}) = \frac{\pi}{2\sin(x)}$ Plotting them both, it seems like there is one solution at latitude $x \approx 1.019$ radians or a latitude of $58.4$ degrees, roughly.

However, there's a twist in the tale because, of course, as @human pointed out,

The above equation is only valid modulo $2\pi$ so we can add an integer multiple of $2\pi$ to the left hand side of the equation and also get a valid solution i.e, $\log(\frac{\tan(x) + \sec(x)}{-\cot(x) + \csc(x)}) + 2k\pi = \frac{\pi}{2\sin(x)}$ for $k \in \mathbb{Z}$. The right hand side is strictly decreasing on the interval $(0, \pi/2)$ and the left hand side is convex with limits of $+\infty$ at both ends of the interval and a steeper slope at zero so for each value of $k$ there is one intersection point between the curves i.e, one solution.

For negative $k$

The last leg of the journey "encircles the Earth" (in the sense of intersecting the same line of longitude) $k$ more times than the second leg. The solutions are always very close to $\pi/2$ i.e, the North Pole, even when $k=-1$. This is a result of the fact that the rhumb line spins infinitely many times as it approaches the North Pole.

For positive $k$

The second leg "encircles the Earth" $k$ more times than the last leg. These solutions tend more gradually towards (zero) the equator as $k$ increases.

As $k \rightarrow \infty$, the solution goes to the equator. At the equator, a $\pi/2$ movement south brings us to the South Pole from where all directions (except North) are ill-defined so we don't have a solution here. As $k \rightarrow -\infty$, however, the solution tends to the North Pole. The North Pole itself constitutes a valid and very interesting solution. After the first two legs of the journey we are at the equator. From there, travelling along the rhumb line, we wind around the North Pole an infinite number of times in order to reach it but do so in a finite distance ($\sqrt{2} \frac{\pi}{2}$). This is one of the incredible facts about the rhumb line. It is seemingly infinite at both ends but is finite in length (rather counterintuitive).