[GRASSLIST:1497] Re: bearing/angle

Laurent BESSON laurent at caribou.u-bourgogne.fr
Wed Oct 15 09:02:24 EDT 2003


If your first point P1 as the following coordinates:
(x1,y1) and your P2 as the coordinates (x2,y2)

You can get the angle by the formula:
arctan((y2-y1)/(x2-x1))

or alternatively:
arcsin((x2-x1)/dist)

or 
arccos((y2-y1)/dist)

Can anyone correct me if i'm wrong

Laurent



On Wed, 15 Oct 2003, Christian G. Tveen wrote:

> 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
> 

-- 
******************************************************
* Laurent BESSON   *   Laboratoire de Cartographie   *
*                  *   Universite de Bourgogne       *
*                  *   Dijon, France                 *
*                  ***********************************
*                  *   Equipe ingenierie informatique*
*                  *   et Bases de Donnees           *
*                  *   Laboratoire LE2I              *
*                  *   Universite de Bourgogne       *
*                  *   Dijon, France                 *
******************************************************
* "S'aimer, ce n'est pas se regarder l'un l'autre,   *
*  c'est regarder ensemble dans la même direction.   *
*         Antoine de Saint-Exupéry                   *
******************************************************




More information about the grass-user mailing list