PostGIS  3.3.9dev-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 2509 of file measures.c.

2510 {
2511  if (A->x == B->x && A->y == B->y)
2512  return LW_FALSE;
2513  *d = fmod(2 * M_PI + M_PI / 2 - atan2(B->y - A->y, B->x - A->x), 2 * M_PI);
2514  return LW_TRUE;
2515 }
#define LW_FALSE
Definition: liblwgeom.h:109
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:108
double y
Definition: liblwgeom.h:405
double x
Definition: liblwgeom.h:405

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: