[GRASSLIST:1499] RE: bearing/angle
Dan Gelinas
Daniel.Gelinas at safe.com
Wed Oct 15 12:38:49 EDT 2003
Not sure if a COGO (coordinate Geometry) module is available for grass. It probably wouldn't be hard to add this to grass using c.
The manual way to calculate bearing/angle is the following:
Known information: Eastings/Northing x/y coordinates of your two points, for example, based on the first quadrant:
a = 1.5, 1.4
b = 4.1, 3.4
Distance ab is calculated:
dx = xb - xa = 4.1 - 1.5 = 2.6
dy = yb - ya = 3.4 - 1.4 = 2.0
ab = sqrt(sqr2.6 + sqr2.0) = 3.28
Azimuth (@) is calculated as such:
@AB = arc tg 2.6/2.0 = 52o26'
All other quadrants:
First Quad: dx:+ dy:+
Second Quad: dx:+ dy:-
third Quad: dx:- dy:-
Forth Quad: dx:- dy:+
-Daniel
--------------------------------------------------------------------------
Safe Software Q.A. Safe Software Inc. dg at safe.com
Daniel Gelinas, P.Eng. Surrey, BC, CANADA phone: (604) 501-9985
B. Appl. Sc. (Geomatics) http://www.safe.com fax: (604) 501-9965
Solutions for Spatial Data
Translation, Distribution and Access
--------------------------------------------------------------------------
-----Original Message-----
From: Christian G. Tveen [mailto:cgt at navicon.dk]
Sent: Wednesday, October 15, 2003 3:41 AM
To: GRASSLIST at baylor.edu
Subject: [GRASSLIST:1496] bearing/angle
Hello,
I need a way to calculate the bearing / angle between two points. To be
more precise, I need to know in what direction and how long to go from
one point to get to the other. I use the distance functionality to
calculate 'how long to go' but need the direction. Is there any
functions to do so ? If this is not sufficient information, pls. don't
hesitate asking me.
Regards
Christian G. Tveen
More information about the grass-user
mailing list