PostGIS  2.3.7dev-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 496 of file lwstroke.c.

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

Referenced by pt_continues_arc(), and pta_unstroke().

497 {
498  POINT2D ab, cb;
499 
500  ab.x = b->x - a->x;
501  ab.y = b->y - a->y;
502 
503  cb.x = b->x - c->x;
504  cb.y = b->y - c->y;
505 
506  double dot = (ab.x * cb.x + ab.y * cb.y); /* dot product */
507  double cross = (ab.x * cb.y - ab.y * cb.x); /* cross product */
508 
509  double alpha = atan2(cross, dot);
510 
511  return alpha;
512 }
double x
Definition: liblwgeom.h:327
double y
Definition: liblwgeom.h:327

Here is the caller graph for this function: