L - Points on Cycle

Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Description

There is a cycle with its center on the origin. 
Now give you a point on the cycle, you are to find out the other two points on it, to maximize the sum of the distance between each other 
you may assume that the radius of the cycle will not exceed 1000.
 

Input

There are T test cases, in each case there are 2 decimal number representing the coordinate of the given point.
 

Output

For each testcase you are supposed to output the coordinates of both of the unknow points by 3 decimal places of precision 
Alway output the lower one first(with a smaller Y-coordinate value), if they have the same Y value output the one with a smaller X.

NOTE

when output, if the absolute difference between the coordinate values X1 and X2 is smaller than 0.0005, we assume they are equal.

 

Sample Input

2
1.500 2.000
563.585 1.251
 

Sample Output

0.982 -2.299 -2.482 0.299
-280.709 -488.704 -282.876 487.453
 
 
//题目意思,在一个圆心在原点的圆上,给你一个点的坐标,求圆内接正三角形的另两个点坐标
 
//这周做题真的很蛋疼,什么都一次过不了,什么奇奇怪怪的错误都有。
这题用旋转公式,弧度传4*pi/3 ,竟然是错的,必须传-2*pi/3,真是不懂,好烦!!!
 
 
 #include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std; const double pi=3.141592654; int main()
{
int t;
scanf("%d",&t);
double x,y;
double x1,y1,x2,y2;
while (t--)
{
scanf("%lf%lf",&x,&y);
x1=x*cos(*pi/)-y*sin(*pi/);
y1=x*sin(*pi/)+y*cos(*pi/);
x2=x*cos(-*pi/)-y*sin(-*pi/);
y2=x*sin(-*pi/)+y*cos(-*pi/); if (y1<y2||(y1==y2&&x1<x2))//题目要求,y值小的在前面,y一样x小的在前面
printf("%.3lf %.3lf %.3lf %.3lf\n",x1,y1,x2,y2);
else
printf("%.3lf %.3lf %.3lf %.3lf\n",x2,y2,x1,y1);
}
return ;
}
 
 
 
 
 

L - Points on Cycle(旋转公式)的更多相关文章

  1. 2016HUAS暑假集训训练2 L - Points on Cycle

    题目链接:http://acm.hust.edu.cn/vjudge/contest/121192#problem/L 这是一道很有意思的题,就是给定一个以原点为圆心的圆,然后给定 一个点  求最大三 ...

  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

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

  4. 暑假集训(2)第九弹 ----- Points on Cycle(hdu1700)

                                                Points on Cycle Time Limit:1000MS     Memory Limit:32768 ...

  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. HDU1700:Points on Cycle

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

  9. hdu1700 Points on Cycle (数学)

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

随机推荐

  1. 倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)-人机界面HMI自锁按钮和自复位按钮如何理解(Toggle variable Tap variable)

    我分别创建两个按钮,自锁和自复位,绑定到主程序的两个布尔值上去   自锁按钮是指点击一下为TRUE,再点击一下为FALSE,自复位按钮是指按下的时候为TRUE,松开的时候为FALSE(也可以勾选Tap ...

  2. CentOS 6.4 图文安装教程(有些设置大部分教程没出现过)

    http://www.jb51.net/os/78318.html CentOS 6.4 下载地址: http://www.jb51.net/softs/78243.html 1.首先,要有一张Cen ...

  3. 【Android Studio探索之路系列】之中的一个:Android Studio开篇

    作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells github:https://github.co ...

  4. EXTJS4自学手册——简单图形(circle,rect,text,path)

    一.画圆形: xtype: 'button', text: '画图一个圆', handler: function (btn) { Ext.create('Ext.window.Window', { l ...

  5. RSA的密钥把JAVA格式转换成C#的格式(2)

    把C#格式转换成Java:RSA的密钥把JAVA格式转换成C#的格式(1) 我已经在第一篇介绍过如何把C#格式转换成Java,现在来看看如何把Java格式转换成C#. /// <summary& ...

  6. C语言-一个fopen函数中未使用二进制模式(b)引发的血案

    转自:http://blog.csdn.net/hinyunsin/article/details/6401854 最近写了一个网络文件传输模块,为了让这个模块具有更好的移植性,我尽量使用C标准IO ...

  7. nvidia显卡驱动卸载和卸载后的问题

     因为装了nvidia显卡驱动后开机一直处于循环登录界面.password输入正确也是进不去.然后就决定卸载nvidia显卡驱动.安装之后出现还是循环登陆. 是openGL的问题 有至少两种解决方 ...

  8. nginx服务器的负载均衡和动静分离(未完)

    安装nginx,我的博客里面有介绍源码和yum安装. 实战:使用nginx实现动静分离的负载均衡集群 实战:使用haproxy实现负载均衡集群 LB负载均衡集群分为两类:LVS(四层)和Nginx或p ...

  9. 使用scp免passwordserver间传递文件

    1.aserver下执行命令  ssh-keygen -t rsa 2.三个回车 3.在用户的文件夹下 ~/.ssh/产生两个文件,id_rsa,id_rsa.pub 4.把aserver下相应的文件 ...

  10. 红茶一杯话Binder(传输机制篇_上)

    红茶一杯话Binder (传输机制篇_上) 侯 亮 1 Binder是如何做到精确打击的? 我们先问一个问题,binder机制到底是如何从代理对象找到其对应的binder实体呢?难道它有某种制导装置吗 ...