[GRASS5] Angle of Line Function?

Bob Covill bcovill at tekmap.ns.ca
Sat Mar 10 15:25:20 EST 2001


Jeshua Lacock wrote:

> Greetings,
>
> I would greatly appreciate any help with developing a simple function
> that returns the angle (in degrees) of a line when given two points
> (x1, y1 and x2, y2).
>
> Embarrassingly I have spent days trying to figure this out (that's
> what I get for using the teachers edition of geometry in high
> school!!).  ;->
>
> I have ran across a function on the web, but somehow it seems really off:
>      angle = (((Atan((northingDifference/eastingDifference)))*180)/PI)
>
> The points that I am using are UTM coordinates.
>
> I realize that this may seem slightly of topic, however I will
> contribute the developed module when I am done.  I figure that this
> function should be a piece of cake for all of you brilliant people
> out there.
>
> An example set of coordinates are:
>
>   x1  = 265,000
>   y1  = 4,155,000
>
>   x2 = 305,000
>   y2 = 4,154,000
>
> Thanks,
> Jeshua Lacock
> Cartographer/Owner
> http://SierraMaps.com
> http://3dTopoMaps.com
> Telephone: (760) 935-4481
>
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo at geog.uni-hannover.de with
> subject 'unsubscribe grass5'

Jeshua,

If you take a look at the new version of r.profile, it has a routine that returns
the azimuth between two points. Hopefully this helps with what you are looking
for.

A library routine that returns the azimuth between two points would be a nice
feature.

--
Bob Covill

Tekmap Consulting
P.O. Box 2016
Fall River, NS
Canada
B2T 1K6



---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list