边缘无限坐标的重叠框 [英] Overlapping box with infinite edge coordinate

查看:69
本文介绍了边缘无限坐标的重叠框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解无限重叠框的工作原理

I try to understand how does overlapping box with infinity works

为什么以下示例不起作用.除非我尝试引入两个无限值,否则效果很好.

Why does the following exemple doesn't work. It works fine except when i try to introduce two infinite values.

此示例应返回true.

This exemple should return true.

SELECT box '((1,1),(infinity, 1))' && box '((2, 1),(infinity, 1))' AS overlap;
overlap 
---------
f

以下两个示例有效

SELECT box '((1,1),(4, 1))' && box '((2, 1),(infinity, 1))' AS overlap;
overlap 
---------
t


SELECT box '((1,1),(4, 1))' && box '((2, 1),(5, 1))' AS overlap;
overlap
---------
t

所以我的问题是:我在做错什么还是我听不懂?

So my question is : Is there something i'm doing wrong or that i don't understand?

推荐答案

我在PostgreSQL错误列表中询问:

I asked on the postgresql buglist:

汤姆·莱恩(Tom Lane)给了我这个答案:

Tom lane gave me this answer :

为此进行测试

FPge(box1->high.x, box2->high.x)

其中FPge定义为

#define FPge(A,B)    ((B) - (A) <= EPSILON)

当两个high.x值都等于无穷大时,则等于无穷大减去无穷大, 在IEEE算术中得出NaN,因此与epsilon进行比较 错了.

When both high.x values are infinity, you have infinity minus infinity, which yields NaN in IEEE arithmetic, so the comparison to epsilon comes out false.

总的来说,我不认为我们承诺几何运算涉及 无限的端点将表现出理智的行为.大概有船 除此情况外,还需要修复的一些极端情况 可以认为这是受支持的情况.

In general I don't think we promise that geometric operations involving infinite endpoints will behave sanely. There are probably a boatload of corner cases besides this one that'd need to be fixed before we could consider that a supported case.

这篇关于边缘无限坐标的重叠框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆