PostGIS 3.7.0dev-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 881 of file lwstroke.c.

882{
883 POINT2D ab, cb;
884
885 ab.x = b->x - a->x;
886 ab.y = b->y - a->y;
887
888 cb.x = b->x - c->x;
889 cb.y = b->y - c->y;
890
891 double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
892 double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
893
894 double alpha = atan2(cross, dot);
895
896 return alpha;
897}
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390

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

Referenced by pt_continues_arc(), and pta_unstroke().

Here is the caller graph for this function: