basic projection question

Michael Shapiro shapiro at
Thu Jul 8 00:13:11 EDT 1993

In info.grass.programmer you write:

>Gerald I. Evenden (gie at writes on 7 Jul 93:

>>You have totally lost me.

>and you were the only reply :-(

>Let me re-phrase the question. Forget about spheres
>and ellipsoids and earth for a second. I am coding up
>an algorithm that was written for points in a plane
>(call it x-y).  A line extends through two points,
>(x1,y1) and (x2,y2), both of which are in the first
>quadrant of a Cartesian coordinate system.  This line
>crosses the y-axis at some point. The angle 't'
>between the line and the axis is what I am interested

>     |           * (x2, y2)
>     |          /
>     |         /
>     |        *  (x1, y2)
>     |       /
>     |      /
>     -----------------------
>     |    /
>     |   /
>     |t /
>     | /
>     |/
>     |
>    /|
>   / |

>Calculation of the angle is straightforward in the
>x-y plane.  Now enter the complexities of geo
>referenced data, an funny-shaped earth, etc. How would
>this angle be calculated using GRASS library
>functions? (Assuming that the data is in one of 
>the supported coordinate systesms.)

>I suspect that most users of this program that I'm
>writing will never have anything by x-y
>(unreferenced) data, but I was hoping to do what
>is right-n-proper by including support for lat-long


Darrell, what Gerry says is important to understand. The definition of
a line between two points on a plane is unique, but not on on a curved
surface like a sphere or ellipsoid. The "natural" definition is the
line that is the shortest distance between the two points (what is
called a geodesic). If you define lines this way you get a different
angle than if you define the lines some other way- for example
rhumblines (these are lines that appear to be straight on a mercator
projection). Rhumblines are good for navigating based on angles to the
north pole, but they are oddly shaped when drawn on the surface of the
earth and the angle between rhumblines that leave one common points and
join two other points will not be the same as the geodesics which
connect these three same points.

Just code this for planimetric projections and document that it
isn't right for lat/lon. When someone provides a routines for
these calculations perhaps the routine can be included in your code.
Michael Shapiro               shapiro at
U.S. Army CERL                (217) 373-7277
P.O. Box 9005 
Champaign, Ill. 61826-9005

More information about the grass-dev mailing list