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

◆ lw_arc_angle()

static double lw_arc_angle ( const POINT2D a,
const POINT2D b,
const POINT2D c 
)
static

Return ABC angle in radians TODO: move to lwalgorithm.

Definition at line 869 of file lwstroke.c.

870{
871 POINT2D ab, cb;
872
873 ab.x = b->x - a->x;
874 ab.y = b->y - a->y;
875
876 cb.x = b->x - c->x;
877 cb.y = b->y - c->y;
878
879 double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
880 double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
881
882 double alpha = atan2(cross, dot);
883
884 return alpha;
885}
double y
Definition liblwgeom.h:376
double x
Definition liblwgeom.h:376

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

Referenced by pt_continues_arc(), and pta_unstroke().

Here is the caller graph for this function: