Interpolate one point along a line in 3D.
604 double length, slength, tlength;
636 for (i = 0; i < nsegs; i++)
639 POINT4D *p1ptr = &p1, *p2ptr = &p2;
655 double dseg = (
distance - tlength) / slength;
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void interpolate_point4d(const POINT4D *A, const 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 o...
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
double distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWPOINT * lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p)
int lwline_is_empty(const LWLINE *line)
double ptarray_length(const POINTARRAY *pts)
Find the 3d/2d length of the given POINTARRAY (depending on its dimensionality)
static double distance(double x1, double y1, double x2, double y2)