PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ 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 778 of file lwstroke.c.

779 {
780  POINT2D ab, cb;
781 
782  ab.x = b->x - a->x;
783  ab.y = b->y - a->y;
784 
785  cb.x = b->x - c->x;
786  cb.y = b->y - c->y;
787 
788  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
789  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
790 
791  double alpha = atan2(cross, dot);
792 
793  return alpha;
794 }
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331

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

Referenced by pt_continues_arc(), and pta_unstroke().

Here is the caller graph for this function: