这道题目是13山东省省赛的签到题,题目大意是给等边三角形的两个定点,让求逆时针旋转之后的第三个点的坐标,原来不会向量的旋转,在网上找了找,找到一篇挺好的,直接贴过来。

向量的旋转

实际做题中我们可能会遇到很多有关及计算几何的问题,其中有一类问题就是向量的旋转问题,下面我们来具体探讨一下有关旋转的问题。

首aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS0AAAEfCAYAAAAUUZBIAAAACXBIWXMAAA7CAAAOwgEVKEqAAAANsElEQVR4nO3dPXIbRxqA4WbVnoQqBa7yIeAAKkXKdILNSCpQ6gM4dUBS2Z5AmSKWGAiHcJUDl3gVLiEKJgjOADOD+fu6nyfYtUSIBDGYd7obg8F/7h8kgCD+M/UdAGhDtIBQRAsIRbSAUEQLCEW0gFBECwhFtIBQRAsIRbSAUEQLCEW0gFBECwhFtIBQRAsIRbSAUEQLCEW0gFBECwhFtIBQRAsIRbSAUEQLCEW0gFBECwhFtIBQRAsIRbSAUEQLCEW0gFBECwhFtIBQRAsIRbSAUEQLCEW0BnWXPv32Kp2vNn9epOvv39LZadVNP6XfXp2n9U0vvt6ny+VY9xFiEa0h3d2kz6vtv1ilzzd36ayyWhuL9MurYe8WRCZaA7q7+fxj5LRt9fkm3Z2dpRfZOn2dfl1/fYw7BoGJ1mBu05//zgsXabFYpdX6j6vP6eburHqK+MOv6fW+gRgUTrSGcvslXW3+++L39L9fUnr1WK10/udtOnuxaLVMl/f36XLUOwnxiNZAbr9skrVI1x+X6fRh9HTxMPL68bdXX9LtQ7SstUN7ojWI2/TUrPfp7Y/p3jK9u3jo1WO10pfby7RULWhNtAZw9+mPf6eGF78/LbovP16nxdXjaQ1XX27TpWpBa6LVu7t0s3Wew9Wbk6e1rW2miNCJaPXtxblZda7SH58+puXec7aAXaLVs6pzs+rUnrMF1BKtXm2fm1Xzdpytt+scPmcL2CVafdo+NytdpHdVC1anb9P7RXo80bTR23rGd3Jy0sv3ub+/7+X7wDbR6tHTuVkPLt7VLLKfprPfL9L56vG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+mIVkebJ61RV16MruZPtI5kupgPwYpBtHpguhib6WAsotUT08WYjK7iEa2eGXXFYHQVl2gNoMnlm8VrGk0v1me7zJdoDaTJdHHzdTvIOIyu8iBaAzPqmp7RVV5EawRtRl3bt+c4YpUn0RqReI1DrPImWhNo+jmL4tVOm0/E8ZjGJVoTaTrq2r2Nne25th/d5fGLT7Qm1iZeu7crdQfs8hmDpT5WORKtmWgbr+3blrJDihVrojUzx8Rr93tEd8ynNufyGPCSaM1Ul3htRI1YHx8tH+V3pTvRmrntnbDrTl3176beufsI1MbUvwvjEq1A+gjYoX/fdwD6jNM2oSqXaAXVZ8C2DRWZvogVopWBoQI2ByLFLtHKzO5OHi1iIsUhopW5qgjMJWQCRReiVaB9seg7aMJE30SLZ0SGuRMtIBTRAkIRLSAU0QJCES0gFNECQhEtIBTRAkIRLSAU0QJCES0gFNECQhEtIBTRAkIRLSAU0QJCES0gFNECQhEtIBTRAkIRLSAU0QJCES0gFNECQhEtIBTRAkIRLSAU0QJCES0gFNECQhEtIBTRAkIRLSAU0QJCES0gFNECQhEtIJT/A5FX9taJXyL8AAAAAElFTkSuQmCC" alt="" name="图像1" width="204" height="195" align="left" border="0" hspace="12" />先我们先把问题简化一下,我们先研究一个点绕另一个点旋转一定角度的问题。已知A点坐标(x1,y1),B点坐标(x2,y2),我们需要求得A点绕着B点旋转θ度后的位置。

如图:A' 就是A点绕B点旋转θ角度后得到的点,问题是我们要如何才能得到A' 点的坐标。(向逆时针方向旋转角度正,反之为负)研究一个点绕另一个点旋转的问题,我们可以先简化为一个点绕原点旋转的问题,这样比较方便我们的研究。之后我们可以将结论推广到一般的形式上。令B是原点,我们先以A点向逆时针旋转为例,我们过A' 做AB的垂线,交AB于C,过C做x轴的平行线交过A' 做x轴的垂线于D。过点C做x轴的垂线交x轴于点E。

令aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS0AAAEfCAYAAAAUUZBIAAAACXBIWXMAAA7CAAAOwgEVKEqAAAARmklEQVR4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euJwMRwESweiZQCHi7pxOKgL0TKEw0WdmK70IVqGMXXpwHSlF9GyoMnlm4nXMJperI/HxV9Ey5Imh4v5n7OBuMF0FQaiZRlT1/CYrsJCtBxoM3UVvx79EKswES2HiJcbxCpsRGsATT9nkXi10+YTcfiZ6kW0BtJ06jr+Gja2r9p+dBc/P/2I1sDaxOv462LdALt8xmCsP6sQES1PtI1X8Wtj2SCJFTJEyzN94nX8b2jX51ObQ/kZ4Dui5aku8cppjZiJj5bXcl/RHdHyXHEj7LpRl/29oTduE4HKDX1f4BbRUsREwOr+vukAmIxTEaGKF9FSymTAisr+LVvh6YJYgWgFwFbAfECkcIxoBeZ4I9cWMSKFOkQrcGUR8CVkBApdEK0InYqF6aARJphGtPBF2eEl4YFPiBYAVYgWAFWIFgBViBYAVYgWAFWIFgBViBYAVYgWAFWIFgBViBYAVYgWAFWIFgBViBYAVYgWAFWIFgBViBYAVYgWTuICgPAN0QKgCtECoArRAqAK0QKgCtECoArRAqAK0QKgCtECoArRAqAK0QKgCtECoArRAqAK0QKgCtECoArRAqAK0QKgCtECoArRAqAK0QKgCtECoMr/AXujkJg3a6A0AAAAAElFTkSuQmCC" alt="" name="角度" width="226" height="215" align="left" border="0" hspace="12" />A的坐标(x,y),A' 坐标(x1,y1),B的坐标(0,0)。我们可以轻松的获取AB的长度,而且显而易见A' B长度等于AB。假设我们已知θ角的大小那么我们可以很快求出BC和A' C的长度。BC=A' B x cosθ,A' C=A' B x sinθ。

因为∠A' CB和∠DCE为直角(显然的结论),则∠A' CD +∠DCB =∠ECD +∠DCB=90度。

则∠A' CD=∠ECD,∠A' DC=∠CEB=90度,因此可以推断⊿CA' D ∽⊿CBE。由此可以退出的结论有:

BC/BE=A' C/A' D和BC/CE=A' C/CD

当然了DC和A' D都是未知量,需要我们求解,但是我们却可以通过求出C点坐标和E点坐标间接获得A' C和CD的长度。我们应该利用相似的知识求解C点坐标。

C点横坐标等于:((|AB| x cosθ) / |AB|) * x = x*cosθ

C点纵坐标等于:((|AB| x cosθ) / |AB|) * y = y*cosθ

则CE和BE的的长度都可以确定。

我们可以通过相⊿CA' D ∽⊿CBE得出:

AD = x * sinθ   DC = y * sinθ

那么接下来很容易就可以得出:

x1 = x*cosθ- y * sinθ y1 = y*cosθ + x * sinθ

则A' 的坐标为(x*cosθ- y * sinθ, y*cosθ + x * sinθ)

我们可以这样认为:对于任意点A(x,y),A非原点,绕原点旋转θ角后点的坐标为:(x*cosθ- y * sinθ, y*cosθ + x * sinθ)

接下来我们对这个结论进行一下简单的推广,对于任意两个不同的点A和B(对于求点绕另一个点旋转后的坐标时,A B重合显然没有太大意义),求A点绕B点旋转θ角度后的坐标,我们都可以将B点看做原点,对A和B进行平移变换,计算出的点坐标后,在其横纵坐标上分别加上原B点的横纵坐标,这个坐标就是A' 的坐标。

推广结论:对于任意两个不同点A和B,A绕B旋转θ角度后的坐标为:

(Δx*cosθ- Δy * sinθ+ xB, Δy*cosθ + Δx * sinθ+ yB )//结论

注:xB、yB为B点坐标。

结论的进一步推广:对于任意非零向量AB(零向量研究意义不大),对于点C进行旋转,我们只需求出点A和B对于点C旋转一定角度的坐标即可求出旋转后的向量A' B' ,因为向量旋转后仍然是一条有向线段。同理,对于任意二维平面上的多边形旋转也是如此。

以上是比较简单的,最后把结论记好就行了。上面是绕B点进行旋转的,所以Δx = xa - xb, Δy = ya - yb,如果绕A反过来就行了。

题目代码:

/*************************************************************************
> File Name: upc_2217.cpp
> Author: Howe_Young
> Mail: 1013410795@qq.com
> Created Time: 2015年04月29日 星期三 20时03分21秒
************************************************************************/ #include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm> using namespace std; int main()
{
int t;
double x1, y1, x2, y2;
scanf("%d", &t);
while (t--)
{
scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
double x3, y3;
x3 = (x2 - x1) * 0.5 - (y2 - y1) * sqrt(3.0) / 2.0 + x1;
y3 = (y2 - y1) * 0.5 + (x2 - x1) * sqrt(3.0) / 2.0 + y1;
printf("(%.2f,%.2f)\n", x3, y3);
}
return ;
}

向量旋转 UPC 2217的更多相关文章

  1. sdut 2603:Rescue The Princess(第四届山东省省赛原题,计算几何,向量旋转 + 向量交点)

    Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Several days ago, a b ...

  2. POJ-2991 Crane(区间更新+向量旋转)

    题目大意:n个向量首尾相连,每次操作使某个区间中的所有向量都旋转同样的角度.每次操作后都回答最后一个向量的坐标. 题目分析:区间维护向量信息.向量旋转:x1=x0*cos(t)-y0*sin(t),y ...

  3. HDU 1700 Points on Cycle (几何 向量旋转)

    http://acm.hdu.edu.cn/showproblem.php?pid=1700 题目大意: 二维平面,一个圆的圆心在原点上.给定圆上的一点A,求另外两点B,C,B.C在圆上,并且三角形A ...

  4. UVA 11178 /// 向量旋转 两向量夹角

    题目大意: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_proble ...

  5. 简单几何(向量旋转+凸包+多边形面积) UVA 10652 Board Wrapping

    题目传送门 题意:告诉若干个矩形的信息,问他们在凸多边形中所占的面积比例 分析:训练指南P272,矩形面积长*宽,只要计算出所有的点,用凸包后再求多边形面积.已知矩形的中心,向量在原点参考点再旋转,角 ...

  6. “《编程珠玑》(第2版)第2章”:B题(向量旋转)

    B题是这样子的: 将一个n元一维向量向左旋转(即循环移位)i个位置.例如,当n=8且i=3时,向量abcdefgh旋转为defghabc.简单的代码使用一个n元的中间向量在n步内完成该工作.你能否仅使 ...

  7. Uva 11178 Morley's Theorem 向量旋转+求直线交点

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=9 题意: Morlery定理是这样的:作三角形ABC每个 ...

  8. n维向量旋转(循环移位)——学习《编程珠玑》

    问题: 将一个n元一维向量向左旋转i个位置.例如,当n=8且i=3时,向量abcdefgh旋转为defghabc. 简单的代码使用一个n元的中间向量在n步内完成该工作. 你能否仅使用数十个额外字节的存 ...

  9. osg指定向量旋转指定角度

    向量AB,沿着n旋转10度 osg::Vec3 left = AB*osg::Matrix::rotate(osg::inDegrees(10), n); osg::Vec3 right = AB*o ...

随机推荐

  1. PHP_EOL常量

    PHP_EOL 换行符 unix系列用 \n windows系列用 \r\n mac用 \r PHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性 如: <?php echo PHP ...

  2. 响应式设计的5个CSS实用技巧

    正如我在教程响应式Web设计三步走当中所讲的,响应式的Web设计其实并不难,但是要让元素在布局切换时能够平滑过渡就比较考验技巧了.现在我分享在编码时常用的五个CSS技巧并举例说明.这些技巧都是使用简单 ...

  3. div+css知识点

    前端书写规范: 1.所有书写均在英文半角状态下的小写: 2.id,class必须以字母开头: 3.所有标签必须闭合: 4.html标签用tab键缩进: 5.属性值必须带引号: 6.<!-- ht ...

  4. 用C++进行函数式编程

    http://www.programmer.com.cn/12717/   文 / John Carmack 译 / 王江平 <Quake>作者Carmack认为追求函数式的程序设计有着实 ...

  5. 一篇旧文章,结合汇编探索this指针

    //VC6.0下成功编译 #include <iostream.h> class X{ public: void foo(int b,int c){ this->a=b*c; cou ...

  6. 转:六百字读懂Git

    原文来自于:http://www.techug.com/git-in-600-words 译注:来自 Hacker School 的 Mary Rose Cook 最近实现了一个纯 JavaScrip ...

  7. JFS 文件系统概述及布局分析

    JFS 文件系统概述及布局分析 日志文件系统如何缩短系统重启时间 如果发生系统崩溃,JFS 提供了快速文件系统重启.通过使用数据库日志技术,JFS 能在几秒或几分钟之内把文件系统恢复到一致状态,而非日 ...

  8. -_-#【RequireJS】Define a Module

    define({ color: 'black', size: 'unisize' }) define(function() { // Do setup work here return { color ...

  9. 数据结构(树链剖分):BZOJ 4034: [HAOI2015]T2

    Description 有一棵点数为 N 的树,以点 1 为根,且树点有边权.然后有 M 个 操作,分为三种: 操作 1 :把某个节点 x 的点权增加 a . 操作 2 :把某个节点 x 为根的子树中 ...

  10. 使用DateAdd方法向指定日期添加一段时间间隔,使用TimeSpan对象获取时间间隔

    一:使用DateAdd方法向指定日期添加一段时间间隔,截图 二:代码 using System; using System.Collections.Generic; using System.Comp ...