PostGIS  2.4.9dev-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 777 of file lwstroke.c.

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

Referenced by pt_continues_arc(), and pta_unstroke().

778 {
779  POINT2D ab, cb;
780 
781  ab.x = b->x - a->x;
782  ab.y = b->y - a->y;
783 
784  cb.x = b->x - c->x;
785  cb.y = b->y - c->y;
786 
787  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
788  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
789 
790  double alpha = atan2(cross, dot);
791 
792  return alpha;
793 }
double x
Definition: liblwgeom.h:328
double y
Definition: liblwgeom.h:328
Here is the caller graph for this function: