PostGIS  2.5.0beta1dev-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 770 of file lwstroke.c.

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

Referenced by pt_continues_arc(), and pta_unstroke().

771 {
772  POINT2D ab, cb;
773 
774  ab.x = b->x - a->x;
775  ab.y = b->y - a->y;
776 
777  cb.x = b->x - c->x;
778  cb.y = b->y - c->y;
779 
780  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
781  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
782 
783  double alpha = atan2(cross, dot);
784 
785  return alpha;
786 }
double x
Definition: liblwgeom.h:330
double y
Definition: liblwgeom.h:330
Here is the caller graph for this function: