PostGIS  2.5.0dev-r@@SVN_REVISION@@
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 724 of file lwstroke.c.

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

Referenced by pt_continues_arc(), and pta_unstroke().

725 {
726  POINT2D ab, cb;
727 
728  ab.x = b->x - a->x;
729  ab.y = b->y - a->y;
730 
731  cb.x = b->x - c->x;
732  cb.y = b->y - c->y;
733 
734  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
735  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
736 
737  double alpha = atan2(cross, dot);
738 
739  return alpha;
740 }
double x
Definition: liblwgeom.h:327
double y
Definition: liblwgeom.h:327

Here is the caller graph for this function: