题意,给定点A[0~n-1]和B[0],B[1],
A[0]、A[1]映射到B[0]、B[1],求出其余点的映射B[2]~B[n-1],
思路,平移到远点,旋转、伸缩,再平移回去
#include<stdio.h>
#include<math.h>
#define N 10010
#define PI acos(-1)
#define EPS 1e-8
struct Point
{
double x,y;
void input(){scanf("%lf%lf",&x,&y);}
void output(){printf("%.2lf %.2lf\n",x,y);}
}A[N],B[2],PA,PB;
double cosa,sina,k;
double length(Point P)
{
return sqrt(P.x*P.x+P.y*P.y);
}
void rotate(Point &P)
{
double t=P.x;
P.x=P.x*cosa-P.y*sina;
P.y=P.y*cosa+t*sina;
}
void expand(Point &P)
{
P.x*=k;
P.y*=k;
}
int main()
{
int n,i,t,cnt=0;
double a