PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ normalize2d()

static void normalize2d ( POINT2D p)
static

Normalize to a unit vector.

Definition at line 524 of file lwgeodetic.c.

525 {
526  double d = sqrt(p->x*p->x + p->y*p->y);
527  if (FP_IS_ZERO(d))
528  {
529  p->x = p->y = 0.0;
530  return;
531  }
532  p->x = p->x / d;
533  p->y = p->y / d;
534  return;
535 }
#define FP_IS_ZERO(A)
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331

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

Referenced by edge_calculate_gbox().

Here is the caller graph for this function: