PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ azimuth_pt_pt()

int azimuth_pt_pt ( const POINT2D A,
const POINT2D B,
double *  d 
)

Compute the azimuth of segment AB in radians.

Return 0 on exception (same point), 1 otherwise.

Definition at line 2462 of file measures.c.

2463 {
2464  if (A->x == B->x && A->y == B->y)
2465  return LW_FALSE;
2466  *d = fmod(2 * M_PI + M_PI / 2 - atan2(B->y - A->y, B->x - A->x), 2 * M_PI);
2467  return LW_TRUE;
2468 }
#define LW_FALSE
Definition: liblwgeom.h:94
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390

References LW_FALSE, LW_TRUE, POINT2D::x, and POINT2D::y.

Referenced by _lwt_AddEdge(), _lwt_FindAdjacentEdges(), _lwt_InitEdgeEndByLine(), LWGEOM_angle(), LWGEOM_azimuth(), and lwt_GetFaceContainingPoint().

Here is the caller graph for this function: