题目链接

水题,卡了下下精度。

 #include <cstdio>
#include <iostream>
#include <cmath>
using namespace std ;
#define PI acos(-1.0)
#define eps 1e-8
int judge(double x,double y)
{
double a;
a = x-y;
if(a < )
a = -a;
if(a < eps)
return ;
else
return ;
}
int main()
{
double x,y,lx,rx,ly,ry,a;
int t;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf",&x,&y);
a = PI/*;
lx=x*cos(a)-y*sin(a);
ly=x*sin(a)+y*cos(a);
rx=x*cos(a)+y*sin(a);
ry=-x*sin(a)+y*cos(a);
if(ly - ry > eps)
{
swap(ly,ry);
swap(lx,rx);
}
else if(judge(ly,ry))
{
if(lx - rx > eps)
{
swap(ly,ry);
swap(lx,rx);
}
}
printf("%.3lf %.3lf %.3lf %.3lf\n",lx,ly,rx,ry);
}
return ;
}

HDU 1700 Points on Cycle(向量旋转)的更多相关文章

  1. HDU 1700 Points on Cycle (坐标旋转)

    题目链接:HDU 1700 Problem Description There is a cycle with its center on the origin. Now give you a poi ...

  2. hdu 1700 Points on Cycle(坐标旋转)

    http://acm.hdu.edu.cn/showproblem.php?pid=1700 Points on Cycle Time Limit: 1000/1000 MS (Java/Others ...

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

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

  4. hdu 1700 Points on Cycle 水几何

    已知圆心(0,0)圆周上的一点,求圆周上另外两点使得三点构成等边三角形. 懒得推公式,直接用模板2圆(r1=dist,r2=sqrt(3)*dist)相交水过 #include<cstdio&g ...

  5. Points on Cycle (hdu1700,几何)

    Points on Cycle Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  6. hdu1700 Points on Cycle

    地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=1700 题目: Points on Cycle Time Limit: 1000/1000 MS ...

  7. Points on cycle

    Description There is a cycle with its center on the origin. Now give you a point on the cycle, you a ...

  8. HDU-1700 Points on Cycle

    这题的俩种方法都是看别人的代码,方法可以学习学习,要多看看.. 几何题用到向量.. Points on Cycle Time Limit: 1000/1000 MS (Java/Others)     ...

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

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

随机推荐

  1. python 之socket 网络编程

    socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. socket起源于Un ...

  2. OCJP(1Z0-851) 模拟题分析(六)over

    Exam : 1Z0-851 Java Standard Edition 6 Programmer Certified Professional Exam 以下分析全都是我自己分析或者参考网上的,定有 ...

  3. 【openGL】指定着色模型

    #include "stdafx.h" #include <GL/glut.h> #include <stdlib.h> #include <math ...

  4. spring 集成 log4j 配置

    在web.xml中增加如下代码: <context-param> <param-name>log4jConfigLocation</param-name> < ...

  5. Solr入门之(3)常用概念说明(持续补充):

    由于solr底层使用lucene,所以很多概念与lucene相同,下面是几个常用的概念: * Document:一个要进行索引的单元,相当于数据库的一行纪录,任何想要被索引的数据,都必须转化为Docu ...

  6. 搜索引擎爬虫技术研究(爬虫框架)-WebCollector

    一.简介: https://github.com/CrawlScript/WebCollector/blob/master/README.zh-cn.md 二.使用: <dependency&g ...

  7. 将数据导出成excel表

    /// <summary> /// 生成excel表 /// </summary> /// <param name="dt">数据表</p ...

  8. WebRTC音视频引擎研究(1)--整体架构分析

    WebRTC技术交流群:234795279 原文地址:http://blog.csdn.net/temotemo/article/details/7530504     1.WebRTC目的     ...

  9. C# RFID windows 服务 串口方式

    话说RFID以前很火所以整理一下一年前自己处理的RFID程序,放源码. 一开始觉得他是个很神奇的东西. 包含串口通讯和网络通讯. 由于网络通讯设备太贵,所以国内的设备基本上都是在外置一个比较便宜的模块 ...

  10. 接着上一篇 《Is WPF dead》

    最近美国的PM传来消息,说微软在收集开发者的意见,会对WPF进行改进,微软会主要在1) performance 2) interop 3) touch and 4) access to WinRT A ...