//将坐标旋转alpha度
void rotate(double x1, double y1, double alpha, double& x2, double& y2)
{
x2 = x1 * cos(alpha) - y1 * sin(alpha);
y2 = x1 * sin(alpha) + y1 * cos(alpha);
}
//得到从l到r的随机浮点数,随机产生alpha
double rand(double l,double r){
return (double)rand() / RAND_MAX * (r - l) + l;
}