]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Point does not return a center of lseg.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 30 Dec 2002 02:18:29 +0000 (02:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 30 Dec 2002 02:18:29 +0000 (02:18 +0000)
Kenji Sugita

src/backend/utils/adt/geo_ops.c

index a2b601a358ccb83e15dfa0a7a4efd8ed3c66dada..d21a5db50e6443f18022bc58d7247abe1bdc1664 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.72 2002/11/29 19:25:33 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.73 2002/12/30 02:18:29 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2043,8 +2043,8 @@ lseg_center(PG_FUNCTION_ARGS)
 
        result = (Point *) palloc(sizeof(Point));
 
-       result->x = (lseg->p[0].x - lseg->p[1].x) / 2.0;
-       result->y = (lseg->p[0].y - lseg->p[1].y) / 2.0;
+       result->x = (lseg->p[0].x + lseg->p[1].x) / 2.0;
+       result->y = (lseg->p[0].y + lseg->p[1].y) / 2.0;
 
        PG_RETURN_POINT_P(result);
 }