Part I Preface
Part II Sketch
Part III Analysis
观察这道题,我们很容易想到,必须推导出 \(x1, y1, x2, y2\) 与 \(x3, y3, x4, y4\) 之间的关系。
我们观察下图。
可以发现:
\(\begin{aligned}\begin{cases}x3 = x2 - (y2 - y1)\\ y3 = y2 + (x2 - x1)\\x4 = x3 - (x2 - x1)\\y4 = y3 - (y2 - y1)\end{cases}\end{aligned}\)
套公式计算即可。
Part IV Code
#include <iostream>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
int x1, x2, y1, y2;
int x3, x4, y3, y4;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> x1 >> y1 >> x2 >> y2;
x3 = x2 - (y2 - y1);
y3 = y2 + (x2 - x1);
x4 = x3 - (x2 - x1);
y4 = y3 - (y2 - y1);
cout << x3 << " " << y3 << " " << x4 << " " << y4;
return 0;
}