Associated Topics || Dr. Math Home || Search Dr. Math

### Spherical 'Rectangles'

```Date: 05/13/2002 at 06:07:22
From: Saira
Subject: Great-Circle Formulae

Sir,

Suppose I have two points on earth, (Lat1, Lon1) and (Lat2, Lon2).
If I consider these to be the the top left and bottom right corners
of a rectangle, how can I find the other two corner points?
And the lengths of the sides of the rectangle?

I am familiar with the Great Circle Formulae and the terms but have
been unable to find any solution to the above problem.

Kindly help me.
Thanks
```

```
Date: 05/13/2002 at 09:33:29
From: Doctor Rick
Subject: Re: Great-Circle Formulae

Hi, Saira.

I might be able to help with this, but first I need to understand
exactly how you wish to define a rectangle on the surface of the
earth. A quadrilateral whose sides are great circles cannot have four
right angles (which is what the word "rectangle", in its Latin
derivation, implies). The sum of the angles will be something greater
than 360 degrees; in fact the excess is directly proportional to the
area of the quadrilateral. So I suppose I would define a "spherical
rectangle" as a figure consisting of four great-circle segments such
that the four angles are all equal (and greater than 90 degrees).
Intuitively, I can see that opposite sides will then have equal
lengths, in agreement with our plane-geometry understanding of
rectangles.

Perhaps you could tell me the reason you need to do this? It might
indicate that some simpler solution will suffice. I don't anticipate
this being an easy problem, if we require full generality and
accuracy.

- Doctor Rick, The Math Forum
http://mathforum.org/dr.math/
```

```
Date: 05/13/2002 at 23:08:16
From: Saira
Subject: Great-Circle Formulae

Sir,

You define a "spherical rectangle" as a figure consisting of
four great-circle segments such that the four angles are all
equal (and greater than 90 degrees). I exactly want that sort
of rectangle.

Now I have two corner points, top left and bottom right, and
I want to find the other two points and the height and width
of the rectangle. Surely, height and width will be the Great
Circle distances.

I need it because I am developing an application in which
the user can enter the latitudes and longitudes of the top left
and bottom right corners, and I have to display the so-called
rectangle on the display.

Kindly help me. I shall be very thankful to you.
```

```
Date: 05/14/2002 at 09:10:36
From: Doctor Rick
Subject: Re: Great-Circle Formulae

Hi, Saira.

There are many rectangles (in the spherical domain as well as in
plane geometry) that have the given diagonal. In the plane analog of
what I think you seek, we want the particular rectangle whose sides
are horizontal and vertical. This task is easy: just use the x and y
coordinates of the given points.

It's easy to draw an analogous figure on the sphere by using the
latitudes and longitudes of the two points; but this will not be
a "spherical rectangle" as we have defined it. It will, in fact, have
four right angles, and only the "vertical" sides will be great
circles (unless one of the points is on the equator). I assume this
is *not* what you seek; you want a true spherical rectangle. I'm not
sure yet *why* you need to go to this trouble, but I'll work on it
anyway.

Here is an outline of an algorithm that will give you what I think
you seek. First find the midpoint of the diagonal. Then draw the line
of longitude ("vertical line") through this center point. Next we can
find the great circle that passes through the "upper left" vertex and
is perpendicular to the vertical line, and likewise the great circle
that passes through the "lower right" vertex and is perpendicular to
the vertical line. Now we have the "horizontal" sides of the
rectangle.

In the same manner we can draw the "horizontal" line (*not* a line of
latitude!) through the center point. This will be the great circle
through the center point and perpendicular to the vertical line. Then
draw the great circle that passes through the "upper left" vertex and
is perpendicular to the "horizontal" line, and likewise for
the "lower right" vertex. We've got all the great circles defined;
all that remains is to find the intersections of pairs of great
circles to obtain the other two vertices of the rectangle.

Note that it is not sufficient to get the vertices; you will need the
great circles too in order to draw the "rectangle", so it's good that
the algorithm I have outlined generates the great circles along the
way.

You can use vector algebra to find the great circle through a given
point and perpendicular to a given great circle. First find the
normal to the given great circle; if you know two points A and B on
the great circle, then the vector

N = AxB

is normal to it. Then take the cross-product of this vector with
vector C corresponding to the given point; this vector

M = (AxB)xC

is normal to the great circle we seek. Then to find the intersection
of this great circle with the given great circle, take the cross-
product of N and M. Thus the intersection point is along the vector

(AxB)x((AxB)xC)

See this item in the Dr. Math Archives for a related problem:

Distance from a Point to a Great Circle
http://mathforum.org/dr.math/problems/bellamy.5.24.00.html

The only other tool I think you'll need is an algorithm to find the
midpoint of the great circle between given points A and B. For this I
will point you to a useful resource for navigation formulas:

Aviation Formulary V1.35: Intermediate points on a great circle
http://williams.best.vwh.net/avform.htm#Intermediate

- Doctor Rick, The Math Forum
http://mathforum.org/dr.math/
```
Associated Topics:
College Higher-Dimensional Geometry

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search