以原点为圆心,给出圆上的一点,要求圆上的另外两点,使得这三个点的距离和最大,很容易想到这是一个等边三角形
然后有这两个公式 点a为已知点
a*b=|a|*|b|*cos(120);

x*x+y*y=r*r;

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

 # include <iostream>
# include <cstdio>
# include <cstring>
# include <algorithm>
# include <cmath>
# include <queue>
# define LL long long
using namespace std ; int main ()
{
//freopen("in.txt","r",stdin) ;
int T ;
scanf("%d" , &T) ;
while(T--)
{
double x , y , x1 , y1 , x2 , y2 , a ,b ,c , r;
scanf("%lf %lf" , &x , &y) ;
r = sqrt(x*x + y*y) ;
a = r * r ;
b = r * r * y ;
c = (r*r*r*r-*x*x*r*r)/4.0 ;
y1 = (-1.0*b - sqrt(b*b - *a*c))/(*a) ;
y2 = (-1.0*b + sqrt(b*b - *a*c))/(*a) ;
if (fabs(x-) < 1e-)
{
x1 = -sqrt(r*r - y1*y1) ;
x2 = sqrt(r*r - y2*y2) ;
}
else
{
x1 = (-r*r/-y*y1)/x ;
x2 = (-r*r/-y*y2)/x ;
}
printf("%.3lf %.3lf %.3lf %.3lf\n" , x1 , y1 , x2 , y2) ; } return ;
}

hdu 1700 (圆的内接三角形 要周长最大)的更多相关文章

  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 3511 圆扫描线

    找最深的圆,输出层数 类似POJ 2932的做法 圆扫描线即可.这里要记录各个圆的层数,所以多加一个维护编号的就行了. /** @Date : 2017-10-18 18:16:52 * @FileN ...

  3. python脚本1_给一个半径求圆的面积和周长

    #给一个半径,求圆的面积和周长,圆周率3.14 r = int(input('r=')) print('area='+str(3.14*r*r)) print('circumference='+str ...

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

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

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

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

  6. HDU 1828 Picture (线段树+扫描线)(周长并)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1828 给你n个矩形,让你求出总的周长. 类似面积并,面积并是扫描一次,周长并是扫描了两次,x轴一次,y ...

  7. HDU 1828 Picture(长方形的周长和)

    HDU 1828 Picture 题目链接 题意:给定n个矩形,输出矩形周长并 思路:利用线段树去维护,分别从4个方向扫一次,每次多一段的时候,就查询该段未被覆盖的区间长度,然后周长就加上这个长度,4 ...

  8. HDU 1392 Surround the Trees (凸包周长)

    题目链接:HDU 1392 Problem Description There are a lot of trees in an area. A peasant wants to buy a rope ...

  9. 【HDU 1828】 Picture (矩阵周长并,线段树,扫描法)

    [题目] Picture Problem Description A number of rectangular posters, photographs and other pictures of ...

随机推荐

  1. CF888G Xor-MST 解题报告

    CF888G Xor-MST 题意翻译 给定一个\(n\)个节点的完全图,每个节点有个编号\(a_i\),节点\(i\)和节点\(j\)之间边的权值为\(a_i\ xor\ a_j\),求该图的最小生 ...

  2. 异步IO的并发能力:backlog的配置很重要

    今天中午正准备完工的时候,发现一个让人抓狂的问题. 一个精简版的AIO应用理论上应该比一个完整版的AIO应用并发能力高一些(因为完整版的事务处理复杂一些),在同一台机器上测试. 但测试结果显示,精简版 ...

  3. E 定向 牛客练习赛25

    tarjan 父节点和子节点 #include <cstdio> #include <cstdlib> #include <cmath> #include < ...

  4. python自带的IDLE如何清屏

    作者:知乎用户 链接:https://www.zhihu.com/question/20917976/answer/32876441 来源:知乎 著作权归作者所有.商业转载请联系作者获得授权,非商业转 ...

  5. MySQL的备份和恢复-mysqldump

    MySQL的备份和恢复-mysqldump 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.为什么需要备份 1>.做灾难恢复 天有不测风云嘛,如果你的服务器被黑客攻击了(比 ...

  6. Oracle之xml的增删改查操作

    工作之余,总结一下xml操作的一些方法和心得! tip: xmltype函数是将clob字段转成xmltype类型的函数,若字段本身为xmltype类型则不需要引用xmltype()函数 同名标签用数 ...

  7. long的变量后面没有L加会有什么后果

    不加L的话,默认就是int型了. 当给long赋值一个超过int范围的值的时候,会出问题. java中对字面的数值是以int的形式来表示的  例如:long l= 6553555522222 报错:T ...

  8. 在Emacs中启用Fcitx输入法

    安装fcitx输入法,在 ~/.xinitrc文件中添加如下内容 (我用startx启动图形环境,所以在~/.xinitrc中配置X会话) export LC_CTYPE="zh_CN.UT ...

  9. CentOS7 关闭防火墙和selinux

    本文将简单介绍在CentOS7上如何临时和永久关闭防火墙和selinux. 关闭防火墙 # 查看防火墙状态 [root@localhost ~]# systemctl status firewalld ...

  10. 360 / 小米 / 百度 随身wifi Ubuntu 下作为无线网卡使用

    这篇文章说得其实很好了,http://www.freemindworld.com/blog/2013/131010_360_wifi_in_linux.shtml 不过因为专利问题,官网貌似不直接提供 ...