简单的几何题目

点(a,b)关于直线Ax+By+C=1对称点的公式

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; double k;
double X1,Y1,X2,Y2,X3,Y3,X4,Y4;
int T;
double a,b,c; int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%lf",&k);
scanf("%lf%lf%lf%lf%lf%lf",&X1,&Y1,&X2,&Y2,&X3,&Y3);
a=k,b=-,c=Y3-k*X3;
X4=X1-*a*(a*X1+b*Y1+c)/(a*a+b*b);
Y4=Y1-*b*(a*X1+b*Y1+c)/(a*a+b*b);
printf("%.2lf\n",max(sqrt((X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1)), sqrt((X2-X4)*(X2-X4)+(Y2-Y4)*(Y2-Y4))));
}
return ;
}

HDU 2671 Can't be easier的更多相关文章

  1. HDU 2671 Can't be easier(数学题,点关于直线对称)

    题目 //数学题//直线 y = k * x + b//直线 ax+by+c=0; 点 (x0,y0); 点到直线距离 d = (ax0+by0+c)/sqrt(a^2+b^2) /********* ...

  2. hdu 2671 shǎ崽 OrOrOrOrz(排序)

    题意:排序后按题目要求输出 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using ...

  3. HBase官方文档

    HBase官方文档 目录 序 1. 入门 1.1. 介绍 1.2. 快速开始 2. Apache HBase (TM)配置 2.1. 基础条件 2.2. HBase 运行模式: 独立和分布式 2.3. ...

  4. hdu 1039 Easier Done Than Said? 字符串

    Easier Done Than Said?                                                                     Time Limi ...

  5. HDU 1039.Easier Done Than Said?-条件判断字符串

    Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/O ...

  6. 题解报告:hdu 1039 Easier Done Than Said?

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1039 Problem Description Password security is a trick ...

  7. HDU 1039.Easier Done Than Said?【字符串处理】【8月24】

    Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple ...

  8. HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)

    Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy ...

  9. HDU 1039 -Easier Done Than Said?

    水水的 #include <iostream> #include <cstring> using namespace std; ]; bool flag; int vol,v2 ...

随机推荐

  1. poj1256(全排列stl)

    #include<stdio.h>#include<string.h>#include<algorithm>using namespace std;bool cmp ...

  2. python读取bin文件并下发串口

    # coding:utf-8import time, serialfrom struct import *import binascii file = open('E:\\1.bin', 'rb')i ...

  3. linux ssh连接不自动断开

    修改linux服务器ssh配置文件: vim /etc/ssh/ssh_config 修改两处的值为: ClientAliveInterval ClientAliveCountMax 使修改的ssh配 ...

  4. APP测试--测试日报和上线报告

    1 测试日报包含: 1 对当前测试版本质量进行分级 2 对较严重的问题进行举例,提示开发人员优先修改 3 对版本的整体情况进行评估 2 上线报告: 1 对当前版本质量进行分级 2 附上测试报告(功能测 ...

  5. Memcached启动脚本

    ched: MemCached Daemon # # chkconfig: - # description: MemCached Daemon # # Source function library. ...

  6. 观后感-MySQL索引类型 btree索引和hash索引的区别

    http://www.cnblogs.com/osfipin/p/4943229.html.http://www.2cto.com/database/201411/351106.html-文章地址 首 ...

  7. DHCP 协议的 8 种消息类型及功能服务器

    1) 主机发送 DHCP Discover 广播包在网络上寻找 DHCP 服务器: 单播数据包, 地址. 2) DHCP 服务器向主机发送 DHCP Offer 单播数据包,包含 IP 地址.MAC ...

  8. Android系统手机端抓包方法(tcpdump)

    抓包准备 1. Android手机需要先获得root权限.一种是否获得root权限的检验方法:安装并打开终端模拟器(可通过安卓市场等渠道获得).在终端模拟器界面输入su并回车,若报错则说明未root, ...

  9. bash color

    紫色:300A24 黄色:C4A000 Tango 紫色: 200213

  10. thinkphp 实现微信公众号开发(二)--实现自定义菜单

    IndexController.class.php <?php namespace Home\Controller; use Think\Controller; class IndexContr ...