轴对齐的矩形交集 [英] axis‐aligned rectangles intersection

查看:161
本文介绍了轴对齐的矩形交集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个算法,需要的轴线排列的矩形和一个排序的数组 返回任何对矩形的重叠

I need an algorithm that takes an unsorted array of axis aligned rectangles and returns any pair of rectangles that overlaps

每个矩形具有两个变量,协调左上角和右下角

Each rectangle has two variables, coordinates of the upper-left corner and the bottom-right corner

推荐答案

这可能是一个有点复杂的面试,要看是什么样的工作, 这是一个几何计算一种算法,

It might be a bit complicated for a job interview , depends what kind of job, It's a geometric computation kind of algorithm,

答案可以在这里找到: <一href="http://www.cs.princeton.edu/~rs/AlgsDS07/17GeometricSearch.pdf">http://www.cs.princeton.edu/~rs/AlgsDS07/17GeometricSearch.pdf

The answer can be found here: http://www.cs.princeton.edu/~rs/AlgsDS07/17GeometricSearch.pdf

这篇关于轴对齐的矩形交集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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