PostGIS 3.0.6dev-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 2461 of file measures.c.

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

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

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

Here is the caller graph for this function: