POJ410 Intersection 计算几何
来源:互联网 发布:sql查询分析器在哪2005 编辑:程序博客网 时间:2024/06/05 17:23
Intersection
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15317 Accepted: 4008
Description
You are to write a program that has to decide whether a given line segment intersects a given rectangle.
An example:
line: start point: (4,9)
end point: (11,2)
rectangle: left-top: (1,5)
right-bottom: (7,1)
Figure 1: Line segment does not intersect rectangle
The line is said to intersect the rectangle if the line and the rectangle have at least one point in common. The rectangle consists of four straight lines and the area in between. Although all input values are integer numbers, valid intersection points do not have to lay on the integer grid.
An example:
line: start point: (4,9)
end point: (11,2)
rectangle: left-top: (1,5)
right-bottom: (7,1)
Figure 1: Line segment does not intersect rectangle
The line is said to intersect the rectangle if the line and the rectangle have at least one point in common. The rectangle consists of four straight lines and the area in between. Although all input values are integer numbers, valid intersection points do not have to lay on the integer grid.
Input
The input consists of n test cases. The first line of the input file contains the number n. Each following line contains one test case of the format:
xstart ystart xend yend xleft ytop xright ybottom
where (xstart, ystart) is the start and (xend, yend) the end point of the line and (xleft, ytop) the top left and (xright, ybottom) the bottom right corner of the rectangle. The eight numbers are separated by a blank. The terms top left and bottom right do not imply any ordering of coordinates.
xstart ystart xend yend xleft ytop xright ybottom
where (xstart, ystart) is the start and (xend, yend) the end point of the line and (xleft, ytop) the top left and (xright, ybottom) the bottom right corner of the rectangle. The eight numbers are separated by a blank. The terms top left and bottom right do not imply any ordering of coordinates.
Output
For each test case in the input file, the output file should contain a line consisting either of the letter "T" if the line segment intersects the rectangle or the letter "F" if the line segment does not intersect the rectangle.
Sample Input
14 9 11 2 1 5 7 1
Sample Output
F
Source
Southwestern European Regional Contest 1995
题意:一个实心的矩形和一条线段,计算 是否有交点.
阅读全文
0 0
- POJ410 Intersection 计算几何
- Intersection (计算几何)
- [POJ1410]Intersection(计算几何)
- poj 1410 Intersection(计算几何)
- POJ 1410 Intersection(计算几何)
- HDU 5120 Intersection (计算几何)
- HDU 5120 Intersection(计算几何)
- cf#21-B-Intersection-计算几何-求直线交点个数
- HDU 5120 Intersection(计算几何+容斥)
- POJ 1410Intersection 计算几何 判断线段与矩形位置
- light oj 1211 - Intersection of Cubes (计算几何)
- POJ 1410 Intersection <计算几何(线段相交判断)>
- 几何 两元相交的面积计算问题 HDU 5120 Intersection(几何模板)
- 周末小测——A(POJ 1410 Intersection(计算几何))
- hdoj.5120 Intersection【计算几何-两圆相交面积】 2015/08/01
- HDU 5120 Intersection (计算几何)2014ICPC 北京站现场赛
- hdoj Intersection 5120 (数学计算几何) 求两个相交圆的面积
- 【Educational Codeforces Round 2D】【计算几何 圆面积交 模板】Area of Two Circles' Intersection
- Composer 的安装和使用
- 笨方法学python 习题4、5、6、7、8、
- POj 1860 Currency Exchange(SPFA判负权)
- SSM(八)动态切换数据源
- python网络爬虫基础(2)--Beautiful Soup库
- POJ410 Intersection 计算几何
- 以太坊abi解析
- ORA-01017: 用户名/口令无效; 登录被拒绝
- mysql触发器详解
- 深入解析Spark中的RPC
- Git忽略规则及.gitignore规则不生效的解决办法
- xp3下保护xuetr
- 一致性哈希算法及其在分布式系统中的应用
- 克服拖延的11种方法