aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/geo_ops.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f3b6a389ff4..8a99df1356c 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -1072,13 +1072,20 @@ line_construct_pm(Point *pt, double m)
{
LINE *result = (LINE *) palloc(sizeof(LINE));
- /* use "mx - y + yinter = 0" */
- result->A = m;
- result->B = -1.0;
if (m == DBL_MAX)
- result->C = pt->y;
+ {
+ /* vertical - use "x = C" */
+ result->A = -1;
+ result->B = 0;
+ result->C = pt->x;
+ }
else
+ {
+ /* use "mx - y + yinter = 0" */
+ result->A = m;
+ result->B = -1.0;
result->C = pt->y - m * pt->x;
+ }
#ifdef NOT_USED
result->m = m;