分析:
如果固定了A不动,那么Q点则以P为圆心,PQ为半径做圆周运动。然后B与Q的相对位置保持不变。那么B上的任意一个点D,则绕着点P+QB,以PQ为半径做圆周运动。题目变成了A是否和B上任意一个顶点画的圆相交的问题了。判断A与圆相交是板子了。同理也固定B不动,A做圆周运动判一下。
代码:
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <cmath>
using namespace std;
struct Point {
double x, y;
Point (double x = 0, double y = 0) : x(x), y(y) {}
};
struct Segment {
Point A, B;
Segment(Point a, Point b) : A(a), B(b) {}
Segment(){}
};
typedef Point Vector;
Vector