PostGIS  2.2.8dev-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 480 of file lwstroke.c.

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

Referenced by pt_continues_arc(), and pta_unstroke().

481 {
482  POINT2D ab, cb;
483 
484  ab.x = b->x - a->x;
485  ab.y = b->y - a->y;
486 
487  cb.x = b->x - c->x;
488  cb.y = b->y - c->y;
489 
490  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
491  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
492 
493  double alpha = atan2(cross, dot);
494 
495  return alpha;
496 }
double x
Definition: liblwgeom.h:312
double y
Definition: liblwgeom.h:312
Here is the caller graph for this function: