PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ interpolate_point4d()

void interpolate_point4d ( POINT4D A,
POINT4D B,
POINT4D I,
double  F 
)

Find interpolation point I between point A and point B so that the len(AI) == len(AB)*F and I falls on AB segment.

Example:

F=0.5 : A-—I-—B F=1 : A------—B==I F=0 : A==I------—B F=.2 : A-I----—B

Definition at line 680 of file lwgeom_api.c.

References lwerror(), POINT4D::m, POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by LWGEOM_line_interpolate_point(), and ptarray_substring().

681 {
682 #if PARANOIA_LEVEL > 0
683  double absF=fabs(F);
684  if ( absF < 0 || absF > 1 )
685  {
686  lwerror("interpolate_point4d: invalid F (%g)", F);
687  }
688 #endif
689  I->x=A->x+((B->x-A->x)*F);
690  I->y=A->y+((B->y-A->y)*F);
691  I->z=A->z+((B->z-A->z)*F);
692  I->m=A->m+((B->m-A->m)*F);
693 }
double x
Definition: liblwgeom.h:352
double m
Definition: liblwgeom.h:352
double z
Definition: liblwgeom.h:352
double y
Definition: liblwgeom.h:352
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: