]> granicus.if.org Git - postgis/commitdiff
Implement missing distance3d_pt_pt function
authorSandro Santilli <strk@keybit.net>
Tue, 9 Jun 2015 11:18:35 +0000 (11:18 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 9 Jun 2015 11:18:35 +0000 (11:18 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13627 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/measures3d.c

index a14205e4ee975385e5f9da8013c3e47b387b482b..f7b022a73a1f8ac146e5b20488e89adbad392a71 100644 (file)
@@ -620,6 +620,15 @@ lw_dist3d_pt_seg(POINT3DZ *p, POINT3DZ *A, POINT3DZ *B, DISTPTS3D *dl)
        return lw_dist3d_pt_pt(p,&c,dl);
 }
 
+double
+distance3d_pt_pt(const POINT3D *p1, const POINT3D *p2)
+{
+  double dx = p2->x - p1->x;
+  double dy = p2->y - p1->y;
+  double dz = p2->z - p1->z;
+  return sqrt ( dx*dx + dy*dy + dz*dz);
+}
+
 
 /**