Skip to content

Commit 500ba40

Browse files
committed
Point does not return a center of lseg.
Kenji Sugita
1 parent b33265e commit 500ba40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/geo_ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.72 2002/11/29 19:25:33 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.73 2002/12/30 02:18:29 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2043,8 +2043,8 @@ lseg_center(PG_FUNCTION_ARGS)
20432043

20442044
result = (Point *) palloc(sizeof(Point));
20452045

2046-
result->x = (lseg->p[0].x - lseg->p[1].x) / 2.0;
2047-
result->y = (lseg->p[0].y - lseg->p[1].y) / 2.0;
2046+
result->x = (lseg->p[0].x + lseg->p[1].x) / 2.0;
2047+
result->y = (lseg->p[0].y + lseg->p[1].y) / 2.0;
20482048

20492049
PG_RETURN_POINT_P(result);
20502050
}

0 commit comments

Comments
 (0)