当前位置:网站首页>Hangzhou Electric Multi-School 6 1009. Map
Hangzhou Electric Multi-School 6 1009. Map
2022-08-08 02:34:00 【Strezia】
1009
复数
题意
给出一个 n × m n\times m n×m 地图,And after scaling down anywhere within the original map(包括边界),As shown in figure rectangularABCDIs the original map,abcdTo map the reduced.
现给出ABCD和abcd八个顶点坐标,There must be a place in the original and the new map coordinates are the same(即图中P),O the point coordinates.
思路
New map by the original narrow/旋转/平移得到.
Considering the plural,Complex multiplication vector can be reduce/旋转,And the plural addition can implement vector translation.
So a point of transformation x → x ′ x\to x' x→x′ 可以写为 x × r + t = x ′ x\times r + t = x' x×r+t=x′,Is multiplied by a coefficient and the coefficient of plus a.Obviously the two coefficients for an arbitrary point in the figure is all the same.
So we can arbitrarily pick two points(比如 A → a , B → b A\to a,B\to b A→a,B→b),解出 r , t r,t r,t ,And then calculate the fixed point.解 x × r + t = x x\times r + t = x x×r+t=x 即可.
代码
complex<double> b[10];
//rx1 + t = y1 && rx2 + t = y2 得到 r,t Plug type solution tox
//rx + t = x;
void solve() {
for(int i = 1; i <= 8; i++) {
int x, y;
cin >> x >> y;
b[i] = {
double(x), double(y)};
}
complex<double> x1 = b[1];
complex<double> x2 = b[2];
complex<double> y1 = b[5];
complex<double> y2 = b[6];
complex<double> t = (y1 * x2 - y2 * x1) / (x2 - x1);
complex<double> r = (y2 - t) / x2;
complex<double> x = t / (complex<double>(1, 0) - r);
cout << x.real() << ' ' << x.imag() << endl;
}
边栏推荐
- Is it safe and reliable to open a securities account?
- LeetCode Binary Tree Series - 144. Sum of Left Leaves
- 三、WinUI3中在OnLauncher处理单例
- 【愚公系列】2022年08月 Go教学课程 032-结构体方法继承
- SAP 的MPN功能
- 正则表达式
- From hardcover to smartcover, the next wave is emerging. Listen to what smart home gurus have to say?
- The Spark based RDD partition and parallel degree 】 【
- Case: ELK log analysis system
- Solve the problem of word flashback when Endnote inserts references
猜你喜欢
随机推荐
idea一些debug技巧
Redis-事物
类和对象的深度剖析
PAT甲级 1060 Are They Equal
SDRAM详解
正则表达式
Overseas Metaverse media must pay attention to the integrity of the propaganda
Enterprise learning (11) to build the main branch, trigger, nailing notice
哪里期货开户低手续费高交返
sci 顶刊中的 3D 密度函数图
机器学习笔记 - 基于CNN+OpenCV的图像着色
机器学习实操的七个步骤
空间地理数据可视化之 leaflet 包及其拓展
意识的概念框架:我们的意识从注意图式产生?
Spark基础【RDD分区和并行度】
LeetCode Binary Tree Series - 144. Sum of Left Leaves
基于图像二维熵的视频信号丢失检测(Signal Loss Detection)
找素数问题
系统滴答及Systick定时器
【HDLBits 刷题 7】Circuits(3)Sequential Logic---Counters

![[Actual combat explanation] Implementation of data blood relationship](/img/ed/d6010a3890ce482f19ee9edabfd4fe.png)







