PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ azimuth_pt_pt()

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

Compute the azimuth of segment AB in radians.

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

Definition at line 2408 of file measures.c.

2409{
2410 if (A->x == B->x && A->y == B->y)
2411 return LW_FALSE;
2412 *d = fmod(2 * M_PI + M_PI / 2 - atan2(B->y - A->y, B->x - A->x), 2 * M_PI);
2413 return LW_TRUE;
2414}
#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(), _lwt_SnapEdgeToExistingNode(), LWGEOM_angle(), LWGEOM_azimuth(), lwt_edgeEnd_fromEdge(), and lwt_GetFaceContainingPoint().

Here is the caller graph for this function: